File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts Pagination

 
Senthilkumar Adaickalam
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I need to display the search results using struts and display tag. Following are the ways i have in mind to implement this but i would like to know the best optimal solution before start my development.

1) retreive the complete search results and store into the HttpSession object.
This may be a performance bottleneck if concurrent sessions opened.

2) retrieve the records from database on demand (let say 10 records per user hit).
Results in more number of costly database calls.

3) retreive the part from database and store into the HttpSession object, let say my search results in 1000 matching records and i will get the first 100 records from the database and put it in the HttpSession object. When the user clicks on page 11, i will query the database again and retreive another 100 recods and store/overwrite into HttpSession object.
I think this is the better approach among the above three.

Please let me know if you have any other better solution and how to implement.
 
suj hande
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The 3rd approach is the most preferred .
 
Brent Sterling
Ranch Hand
Posts: 948
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is usually not a single "best" solution that fits all applications. Your #3 sounds good, but it is also the solution that requires the most work to implement, debug, document and maintain. If you are dealing with small sets of data you may want to not do any caching yourself and let the database handle that.

- Brent
 
Bhaskar Reddy
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Senthil... H R U? do chk your yahoo mailbox for more qns !
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic