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 Struts Validator overriding cache-control?
Date Thu, 15 Jan 2004 00:42:29 GMT
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.
  3. the page is redisplayed with the appropriate error message(s).
  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.
  7. the user refreshes the page via the F5 key or the refresh button, and the page as displayed
in step 3 is redisplayed.

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?

                                  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. 

---------------------------------------------------------------------
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