struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brown, James" <james.br...@ca.unisys.com>
Subject RE: Struts Validator overriding cache-control?
Date Thu, 15 Jan 2004 15:48:41 GMT
Just to follow up with a few questions, based on the following statement:

It is my assumption in this scenario that the browser (IE) has cached the URL and data posted
to said URL, thus it is able to redisplay the page with the data the user has entered.  

1. Is this a correct assumption?  

2. If yes, is this the expected behaviour of a browser for pages that are marked as do not
cache?

3. If yes, is there any known mechanism to force the browser to not cache the POST data?

                                  Cheers,
                                  James

THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus
for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers. 


> > -----Original Message-----
> > From: Hubert Rabago [mailto:jakartauser@yahoo.com]
> > Sent: 2004 January 14 21.57
> > To: Struts Users Mailing List
> > Subject: Re: Struts Validator overriding cache-control?
> > 
> > 
> > The sequence you described is the expected behavior.
> > Comments below.
> > 
> > --- "Brown, James" <james.brown@ca.unisys.com> wrote:
> > > We have encountered a situation wherein it appears that the 
> > server-side
> > > validation provided by the struts-validator and that of
> > > ValidatorForm.validate(...) appears to be overriding the 
> > controller's nocache
> > > value.
> > > 
> > > The scenario we have encountered is follows:
> > >   1. user enters data on a page that is backed by a 
> > subclass of ValidatorForm
> > >   2. form is submitted but one of either server-side 
> > validation for a required
> > > field (set via the struts validator plugin) or the 
> > ValidatorForm.validate(...)
> > > method returns and ActionError.
> > My guess is the form was submitted using METHOD=POST.
> > >   3. the page is redisplayed with the appropriate error 
> message(s).
> > This page is the result of a submitted form.
> > >   4. the user corrects the form and submits.
> > >   5. the subsequent (success) page is displayed.
> > >   6. the user selects the browser's back button and 
> > receives the IE "Warning:
> > > Page has Expired" warning/error.
> > When the user selects the back button, he is trying to 
> > redisplay the page shown
> > in step 3, which can only be displayed by resubmitting the 
> > form.  IE will not
> > resubmit a form without informing the user, and therefore 
> > shows this warning to
> > tell the user.
> > >   7. the user refreshes the page via the F5 key or the 
> > refresh button, and the
> > > page as displayed in step 3 is redisplayed.
> > This is expected because the form that was submitted in step 
> > 2 was resubmitted by
> > IE to display the page requested by the user.
> > > 
> > > Our controller is set to not cache any pages via:
> > >   <controller>
> > >     <set-property property="nocache" value="true"/>
> > >   </controller>
> > > 
> > > The ValidatorForm/ActionForm's scope is also set to 
> > request, thus the page
> > > should be displayed empty.
> > > 
> > > This situation only occurs if the form is submitted with 
> > data that fails
> > > server-side validation and the page is redisplayed.  In a 
> > true "success" path,
> > > the page is displayed as desired - empty.
> > > 
> > > Any ideas?
> > 
> > Your user tried to redisplay the result of an errant form, 
> > and so WILL get the
> > page with the error message.  If you want to display an empty 
> > form, perhaps to
> > allow the user to enter another set of data, you can provide 
> > a link which the
> > user can follow for a fresh form, or display the form in step 
> > 5 along with your
> > "success" message.
> > 
> > > 
> > >                                   Cheers,
> > >                                   James
> > 
> > 
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
> > http://hotjobs.sweepstakes.yahoo.com/signingbonus
> > 
> > 
> ---------------------------------------------------------------------
> > 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
> 
> 

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


Mime
View raw message