File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Re: Servlet Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Re: Servlet Problem" Watch "Re: Servlet Problem" New topic
Author

Re: Servlet Problem

Joe Cheung
Ranch Hand

Joined: Oct 18, 2002
Posts: 104
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


Joe
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

"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.
Joe Cheung
Ranch Hand

Joined: Oct 18, 2002
Posts: 104
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
Malhar Barai
Author
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
Originally posted by Joe Cheung:
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

This has been discussed many a times in this forum, kindly do a search on it, & you would come across many threads.
hth
MB


Malhar Barai
SOA & Java Book
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Re: Servlet Problem
 
Similar Threads
HSSF and IE
Go to previous page using spring
How to open a web window when user clicks on URL TextView, without leaving app?
got to previous page on click of back button using JSTL
How to disable back button of browser