You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Fowler, Perryn" <Pe...@anz.com> on 2007/05/22 09:32:21 UTC

Struts 2 validation and Redirect After Post

Hi,

I want to use the redirect after post pattern in order to have a web app that is well behaved when the user hits back, refresh etc etc

I also want to use the Struts 2 validation framework.

At first glance though, the two seem incompatible:

If I have a form that I want to submit with a POST, I want the response to this to always be a REDIRECT to a GET.

I probably want this even in the case of validation failures that cause the form to be re-displayed, but the validation 
framework seems to assume that I would forward directly to the view in this case :

ie: it stores error information in the current action to be queried and displayed by tags in the view.
If I were to redirect to the view, this information would be lost.

Is there something I have missed that supports having a redirect  on validation failures?

cheers
Perryn



"This e-mail and any attachments to it (the "Communication") is, unless otherwise stated, confidential,  may contain copyright material and is for the use only of the intended recipient. If you receive the Communication in error, please notify the sender immediately by return e-mail, delete the Communication and the return e-mail, and do not read, copy, retransmit or otherwise deal with it. Any views expressed in the Communication are those of the individual sender only, unless expressly stated to be those of Australia and New Zealand Banking Group Limited ABN 11 005 357 522, or any of its related entities including ANZ National Bank Limited (together "ANZ"). ANZ does not accept liability in connection with the integrity of or errors in the Communication, computer virus, data corruption, interference or delay arising from or in respect of the Communication."

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