struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Jouravlev <>
Subject Re: using a lookupDispatchAction to implement a WIZARD Form
Date Wed, 09 Nov 2005 00:04:55 GMT
On 11/8/05, arnaud gonzales <> wrote:
> Hello
> I try to use a lookupDispatchAction to implement a WIZARD FORM as it is
> wrote in the Struts cookbook and there is some things i still don't
> understand:
> Context:
> <action path="/ViewStep1"
> name="CreateAccesForm"
> scope="session"
> validate="false"
> type="org.apache.struts.actions.ForwardAction"
> parameter=".portail.acces.societe"/>
> <action path="/ProcessStep1"
> name="CreateAccesForm"
> scope="session"
> validate="true"
> type=""
> input=".portail.acces.societe"
> parameter="method">
> <forward name="next" path="/"/>
> <forward name="fail" path="/"/>
> </action>
> I have a List of DTO in my ActionForm ("CreateAccesForm") and others simple
> properties;
> i do some business in an action( method="Verif" ) to set my
> form properties with the values coming from the DB. When i finally return
> mapping.findForward("fail") which call the forwardAction to
> bring me back to the same jsp, my input form.
> So, my jsp page ".portail.acces.societe" only display the values of my List
> form properties and the others have disappear!
> But if i use a forward path directly to my jsp, like that :
> <forward name="fail" path=".portail.acces.societe"/>
> I can find the real values of my form properties set in the html form.
> So my question is why the org.apache.struts.actions.ForwardAction resets my
> form simple properties according to what it find in the request, i imagine,
> and does not to the DTO List properties ??

Because when request comes in, Struts populates ActionForm fields from
request. When you do "forward", this is the same as incoming request
for Struts. And since it is an in-server forward, the request still
contains old data.

Why would not you try something more robust for your wizard:

Here are two online demos, very similar. The first is a login/signup

The second is just a signup wizard with a security question:

Notice, that for all wizard pages the address in the browser is the
same, so you cannot go back to a stale page. Navigation is performed
on server, browser sees only the page that corresponds to current
wizard state.

Struts Dialogs: code-behind for Struts

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message