Marcio Ghiraldelli wrote the following on 3/22/2006 8:46 AM:
Hello,
I am facing a strange ActionForm Reset behavior with Struts 1.2:
I want after submit a form, redirect via controler to the same form
(so the user can submit it subsequently times).
If you want to just return to the same page after you submit, then
simply provide that as the return value in your Action and have it
mapped just like you would for going to any other page in your flow.
There is no difference what so ever. Maybe I'm confused what you are
trying to accomplish?
Should the normal behavior be:
1) Controler receives the first request (Action.do)
2) My Action class populate the request properly
3) Controler redirects to the form view
4) View calls an ActionForm (request scope)
5) ActionForm Reset method is executed, accessing the request properly
6) User submits the Form (ActionSubmit.do)
7) Controler redirects to ActionSubmit.class
8) ActionSubmit works ok, and return a Forward to recall the Action.do
I didn't read all the steps you have above although some steps are
definitely wrong. The reset method is always called on every action
request. But what are you trying to do in your reset method that would
mess with stuff? Typically you only need to use the reset for setting
booleans to false, and/or possibly resetting the size of some nested
Lists in your ActionForm.
The steps above should implement a loop of subsequently submits (for
adding itens in a list by example) but after the first submit, in the
second step, the reset method is executed BEFORE the Action.do, with
an empty request, breaking down the view proccess, 'couse the form
isn't populated correctly.
You should be populating your form in the Action, not the reset.
--
Rick
http://www.learntechnology.net
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]