Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to redirect to a different page when a browser's Back button is clicked

843836Jun 14 2005 — edited Jun 16 2005
In my application a user logs-in and searches on the form provided. Now
If a I click on browser's Back Button I see a message saying Page Has Expired, now at this point if I click on the browsers refresh button it shows me the page again.I want if browser back button is clicked and then Refresh button is clicked I don't want to show the same page rather redirect to a different page and invalidate the session. Is there a way clicking on browser back button I redirect to a different page.I have the following code on top of each jsp pages:
response.setHeader("Cache-Control","no-cache"); //forces caches to obtain a new copy of the page from the origin server
response.setHeader("Cache-Control","no-store"); //directs caches not to store the page under any circumstance
response.setDateHeader("Expires", 0); //causes the proxy cache to see the page as "stale"
response.setHeader("Pragma","no-cache"); //HTTP 1.0 backward compatibility
Any help is appreciated. Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 14 2005
Added on Jun 14 2005
5 comments
332 views