• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

This interesting problem

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello people,

I have this problem.
I have to show over 20000 records from the DB(database) in a jsp. I get 300 records at a time in the jsp and have a button to display the next 300 records.
On clicking this button, the form is submitted and the next set of 300 is fetched from the DB
To keep track of the set to be shown currently, I set an attribute in the session and increment it by one after every fetch.
The problem is, if a user is on the 6th set and goes to the first one by pressing the browser back button, then, on clicking fetch more, he will get the 7th set rather than the 2nd one. If the user is using browser's back button, how would I track which set of record is he currently seeing?

Regards,
Rahul.
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The solution seems to be to not set the set number on the session but instead submit the set number when the user clicks the "fetch more" button. This could be done by saving the number in a hidden field.

- Brent
 
Today you are you, that is turer than true. There is no one alive who is youer than you! - Seuss. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic