Re: Struts 2 validation and Redirect After Post
I think what you are after is a flash scope implementation. There is a flash result and flash interceptor that Pat/Toby checked into the webwork project. With a couple small changes they will work in s2. At some point I guess they should be moved across. /Ian Fowler, Perryn wrote: 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 validation and Redirect After Post
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Perryn, Fowler, Perryn wrote: 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: Pretty much. Why do you want to redirect after validation failure? In Struts 1 (not sure about S2), you had no choice: you were automatically forwarded to the input forward when validation failed. Is there a specific reason you want to forward? 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. Right. You would have to add some kind of error-conversion code to take all the information out of the request and put it either into the session (which would be a mess) or into the outgoing redirect location in order to pick it up on the other side. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGVDQk9CaO5/Lv0PARAsLhAJsFPVRyeF0+y+z6BwjWtvZCxF4bFQCfQf78 ug0irNhW56Jqu1geooP1sas= =NS3j -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]