Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Listing results  RSS feed

 
Zein Nunna
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I have a Servlet that will carry out some computation then direct users to a JSP. On the JSP I'll have to list the data (comments by previous users). There can be up to a 1000 in total.

What I want to do is list say 10 comments a page and then have links on the bottom for the next 10-20, 21-20, ... what is the best way of doing this?

Would all the data be trasferred at once from the Servlet to the JSP, and then the JSP orders it accordingly, or will it trasnferred from the servlet to the JSP in chunks of 10, and on each link I go back to the servlet, carry out another database opperation and extract some more data.

If it helps, I open to using JSF if it makes life easier?

Thanks in advance for your help.
Regards
Zein
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've moved this to the JSP forum as it is not a Javascript issue.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please see the JSP FAQ entry on pagination. This is best handled in the database.
 
Zein Nunna
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cheers Bear

I see the logic in only retrieving the results that you need from the Database.

Great article.

Thanks
Zein
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!