Hi
I am creating wizzard application that contains 5 screens. It looks like:
Action -> jsp ->Action -> jsp ->Action ->jsp ...
I also use autovalidation.
All my actions are setup actions (as Michael Jouravlev suggests).
So if i submit a form from jsp to some Action and validation fails struts
forwards me where input parameter for Action points.
I need to be forwarder to previous action (to setup Action) that will
prepare my view (for example retrieve some data from DB) and then shows me
my invalid form/jsp.
Because all my jsps contain 2 buttons: next and back i decided that all my
actions will extends EventDispatchAction, so if validations fails i wanna to
be forwarded to previous
action next() method.
One soultion i found is to add extra parameters to forward paths in struts
configuration file:

<action name="viewBean" path="/showStep3" scope="session" type="
foo.bar.ShowStep3" input="/showStep2.do?next=true" parameter="next,back">
           <forward name="success" path="/step3.jsp"
contextRelative="true">
           </forward>
           <forward contextRelative="true" name="back"
path="/showStep1.do?next=true">
           </forward>
       </action>


Is it good idea??
Does anyone have another solution??
Maybe EventDispatchAction shouldn't be used in my case...

Reply via email to