• Post Reply Bookmark Topic Watch Topic
  • New Topic

Pagination using session?  RSS feed

 
Tanmoy Palodhi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to implement pagination in my JSP without using the displaytag.
Also, I dont want to use LIMIT in my SQL query and hitting the database all the time.

Can anyone tell me how I can implement by storing my List object in session and iterate for the page numbers depending upon the parameters passed?
Is that possible anyhow? Will it be a good idea to keep it in session?

Thanks in advance.
Tanmoy
 
Vijitha Kumara
Bartender
Posts: 3993
31
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tanmoy Chatterjee wrote:Also, I dont want to use LIMIT in my SQL query and hitting the database all the time...

Why? User may not need all the records at all, in that case it would be a waste.
Can anyone tell me how I can implement by storing my List object in session and iterate for the page numbers depending upon the parameters passed?
Is that possible anyhow?

You might find this useful.
Will it be a good idea to keep it in session?

If the results depend on the user's settings then fine. If not and you want to store it in the somewhere with one DB call then it may better stored in an application wide (i.e: ServletContext) scope. There can be performance issues with this.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tanmoy Chatterjee wrote:Is that possible anyhow? Will it be a good idea to keep it in session?

Sure, it's possible, and really easy. Is it a good idea? Depends on your app, the number of concurrent users, server capacity/memory, etc.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!