• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

This interesting problem

Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • 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?

Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • 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
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic