File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Page expires using history.back Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Page expires using history.back" Watch "Page expires using history.back" New topic

Page expires using history.back

Andy Deighton
Ranch Hand

Joined: Apr 01, 2003
Posts: 39
I'm sure this has been covered LOTS of times, but I'm finding it hard to get a Struts-related answer to this.
I have a form (mapped to an ActionForm). It gets submitted and a page is displayed with the results. I want to let the user go back to the form and AMEND their input and re-submit. Now, it's easy to hit the Back button, but this produces a page expired message generated by the browser. I know I should really have an action that re-displays the form jsp, with the ActionForm instance that is still in the session. However, this doesn't seem to work either.
Is there a definitive solution for allowing an ActionForm to be re-displayed without the page expired error coming up (even if the user has to use a link, rather than hit the Back button)? Any help would be greatly appreciated.
Mokriy Mokriy

Joined: Oct 20, 2004
Posts: 1
I have the same problem. Have you found some solution for that?
Or can anybody help with it?

tukai chakraborty

Joined: Feb 02, 2004
Posts: 11
After successful completion of ur logic in ur Action class u can forward it to the same jsp from which u submitted.

Say in ur struts-config.xml u have
<action name="LoginForm" type="LoginAction" input="/Login.jsp" scope="request" path="/LoginAction">
<forward name="sucess" path="/Login.jsp" />

Now from ur Action Class u have to do
return(mapping.findForward("another")); which will take to ur jsp page and then do necessary upadtes again.

hope it soves ur problem
Sunil Manheri
Ranch Hand

Joined: Jul 07, 2004
Posts: 32
Also you can do like this fron your Action class:

TechMindViews - Technical Notes
I agree. Here's the link:
subject: Page expires using history.back
It's not a secret anymore!