This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Dear all, I am new to Servlet. I want to ask if I write 2 servlet pages, A and B, I write a button in A such that I can go to B by clicking the button. However, I don't want someone can go back to A by clicking Button "Back" in Browser. What should I do? This suggestion actually came from my observation of many web sites in whcih I cannot go back once I log in the web sites and error message "The page is expired" prompted when I click the Button "Back" in Browser. Regards, Joe
"The page is expired" message is a browser message that cannot be controlled by any server-side component, including web servers, servlets, jsp, etc.
The reason that you get this message is that the page you are going "back to" was constructed as a result of an HTTP POST operation (a form submission whose method attribute was set to "POST").
Also note, it's not that you cannot go back to this page, it's that you cannot view the page again until you repost the form submission.
Joined: Oct 18, 2002
Dear Mike Curwen, Thanks for reply. Now I am more understandable to the servlet operating theory. If I really want to disallow user to go back to the previous servlet by clicking "Back" button in browser, what should I do? Regards, Joe