Hi, I'am displaying chunk(10 records) in a page from the database.Using the Next and Previous buttons on my page , I can retrieve 10 records at a time.The problem is explained below. * Retrieve first 10 records(1-10) * using the Next button get next set(10-20) * Now using browser's back button goto previous page(page with the records 1-10) * Now use Next button.Now the expected result is to get 10-20 records page, but i'am getting 20-30 records page. *Also the Previous button behaves in the similar manner.How should I solve this problem. Thanks Mamatha
The problem is that, the Servlet cannot detect user pressing the browser's back button. When the back button is pressed, the browser just displays the old page that is in the cache and no servlet communication takes place. You can solve this problem by maintaining some kind of record number in the request which tells you upto what record is displayed. With each request ( next/prev ) you will add or subtract 10 from the record number and store it as an attribute on the request. This way you will not lose track of what you are displaying and what you should display when the request comes in. Just a suggestion, there might be a better way to do this Ajith
Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).