Hi,
I have a query program which displays data page by page. I have two buttons, next and back, depending on how many rows have to be displayed. I'm using the same
jsp page for displaying all pages. My jsp page uses two
java beans for this. One has request scope which performs the query for every page and gets data. The other has a session scope. It keeps track of how many rows have been viewed, and shows data respective to next and back clicks.
The way I know its a next or back click, is by using request.getAttribute("next") and request.getAttribute("back"). All is fine.....until we click on Refresh button in the browser.
Suppose I get 100 rows in query, and user selects to see 20 rows per page.After seeing the first page, user clicks next button and views the next display. Now, if user clicks Refresh button in the browser(after next click), its being interpreted as another NEXT click.....if user keeps on clicking Refresh button....they will reach end of data. Without clicking next button, they would have viewed all display pages. Similar scenario happens when user clicks back button, and Refresh in browser. The program interprets the Refresh(after a back click) as another back click.
How can I distinguish if its a Refresh from the browser button, and a next or back click ? How can I handle Refresh clicks in Internet Explorer in my program ?
Any suggestions would be welcomed.
Thanks.