File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Warning : Page Expired on clicking Back Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Warning : Page Expired on clicking Back" Watch "Warning : Page Expired on clicking Back" New topic

Warning : Page Expired on clicking Back

sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
I am facing a scenario which is popular across many web applications .. I have a form which submits a few fields on clicking a button . Submitting the form will take it to another view and clicking Back from there will give me the IE page saying Page Expired, Click refresh to submit again.

I know that its coming because of the form using POST method , but how can i avoid this is the best possible way ..

One solution which i am familiar is , after submitting use a redirect than forward so that URL gets updated as GET and clicking back won't cause any issues. IN this case i will be loosing the request varibles and thus it becomes tough to show the error messages

can any one let me know if there is a better solution ??
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I feel your pain on losing the request object. I have done this by putting the message on the URL of the redirect, but it shows in the address bar in the browser which may or may not be ok.

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
srilatha kareddy
Ranch Hand

Joined: Jan 12, 2006
Posts: 32
i can suggest one thing....

u can control back button using javascript there u can write code

one trick is
[ March 01, 2006: Message edited by: srilatha reddy ]
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63874

srilatha reddy, JavaRanch is a community of people from all over the world, many of who are not native English speakers. While using abbreviations like "u" instead of spelling out "you" is convenient when text messaging your friends on a cell phone or in a chat room, it presents an extra challenge to those that are already struggling with English. Additionally, such shortcuts may confound automated translation tools that patrons of the Ranch may be making use of.

I would like to ask for your help in making the content of JavaRanch a little easier to read for everybody that visits here by not using such abbreviations.

Please read this for more information.

[Asking smart questions] [About Bear] [Books by Bear]
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
Hi stan

I appreciate your suggestion but any other better way for doing that as it will expose the error message in the URL
I agree. Here's the link:
subject: Warning : Page Expired on clicking Back
It's not a secret anymore!