You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "news.basebeans.com" <jc...@ca.ibm.com> on 2003/12/03 02:36:08 UTC

Re: Session Scope ActionForm, ActionErrors and the Back Button

Note that when you hit the Back button on a page not cached and retrieved by
a GET, the browser will perform a new request... If the page was retrieved
by a POST, the browser will display an error message or ask the user if he
wants to repost the form.

"Hookom, Jacob" <Ja...@redline.mckhboc.com> wrote in message
news:CDE1F7C8E680D211A93F0008C7F46BFD0A32AB10@exchange2.nu.usgv...
> On the controller element in the struts config, set the "nocache"
attribute
> to true.  We just did this for our current project and it has fixed a lot
of
> issues with our wizard-type flows where we use a SessionBean to dictate
> flow.
>
> The other option is to manually write the pragma/expire headers on the
> action that displays the form to make sure that the particular page
doesn't
> get cached by the client.  We've found that having the JSP declare the no
> cache headers doesn't work too consistently (possibly web designer error).
>
> Action.execute(......) {
> response.setHeader("Pragma", "No-cache");
> response.setHeader("Cache-Control", "no-cache");
> response.setDateHeader("Expires", 1);
> return mapping.findForward("someval");
> }
>
> Jacob Hookom
> Senior Analyst/Programmer
> McKesson Medical-Surgical
> Golden Valley, Minnesota
> http://www.mckesson.com
>
>
> -----Original Message-----
> From: John Topley [mailto:john@johntopley.com]
> Sent: Tuesday, December 02, 2003 12:31 PM
> To: struts-user@jakarta.apache.org
> Subject: Session Scope ActionForm, ActionErrors and the Back Button
>
> My application has a sequence of pages that submit to a single ActionForm
> with
> session scope. The problem I have is that if the user clicks the Back
button
> any
> previous ActionErrors are still displayed, even though the form fields may
> be
> populated with valid values.
>
> Is it possible to specify a session scope ActionForm with request scope
> ActionErrors? How can I solve this problem? I really want to keep the
> ActionForm
> in the session.
>
> I've searched this list but didn't find any solutions.
>
> Thanks in anticipation,
>
> John
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org