-
15 Jan 2009 8:33 PM #1
server implementation on paging grid
server implementation on paging grid
Hi,
I'm looking at the Paging Grid example and have a question on the server implementation.
In ExampleServiceImpl class
I thought posts will always be null every time a new thread is instantiated. In my own implementation, class variables do get set to null ever time. But it seems to be working fine in the demo explorer. Any idea why?Code:private List<Post> posts; public PagingLoadResult<Post> getPosts(final PagingLoadConfig config) { if (posts == null) { loadPosts(); } // ignore the rest }
-
16 Jan 2009 9:20 AM #2
look the code in examples, there are server side code paging implementation





-
16 Jan 2009 5:01 PM #3
Yes, I code I posted above is from the examples.
-
17 Jan 2009 3:32 AM #4
-
18 Jan 2009 10:17 AM #5
My understanding is if servlet is started in a new thread, then
if (posts == null)
will always be true. So loadPost() will be called every time when users click on Next Page on the paging tool. Obviously it should not be the case. What's wrong with my understanding?
-
19 Jan 2009 2:43 PM #6
GXT JavaDocs: http://extjs.com/deploy/gxtdocs/
GXT FAQ & Wiki: http://extjs.com/learn/Learn_About_the_Ext_GWT_Library
Buy the Book on GXT: http://www.apress.com/book/view/9781430219408
Follow me on Twitter: http://twitter.com/gslender
-
19 Jan 2009 7:55 PM #7
I see. Thanks for your help.
But where can I see those codes that handle sessions? I was looking for something like
this.getThreadLocalRequest().getSession();
in the ExampleServiceImpl.java
-
19 Jan 2009 8:02 PM #8
ExampleServiceImpl extends RemoteServiceServlet, which extends HttpServlet
This is a fundamental Servlet function where data is persistent.
Read this -> http://www.novocode.com/doc/servlet-.../chapter1.htmlGXT JavaDocs: http://extjs.com/deploy/gxtdocs/
GXT FAQ & Wiki: http://extjs.com/learn/Learn_About_the_Ext_GWT_Library
Buy the Book on GXT: http://www.apress.com/book/view/9781430219408
Follow me on Twitter: http://twitter.com/gslender


Reply With Quote
