--- ancatdubher <[EMAIL PROTECTED]> wrote:
> I am building a simple registration module. The user accesses
> /signup.action
> to view signup.jsp. This JSP allows him to enter username, password, phone
> and address. When submitted, the /createUser.action is invoked. Validation
> of form data also happens here. When form data is invalid, I do a redirect:
> 
> <action name="createUser">
>     <result name="validationFailed" type="action-redirect">signup</result>
> </action>
> 
> This loses all request attributes.
> I can reclaim the error messages by adding the Message Store interceptor.
> But I would like to be able to display the Signup.jsp back with all fields
> entered by the user. (username, password, phone and address - which are
> members of the USER object member on the createUser action)
> How do I retain these attributes?

One option is to create an "input" result for the createUser action, using
the same JSP as the signup action. 

> <action name="createUser">
>     <result name="input">[[[Same JSP as signup action]]]</result>
> </action>

The validation interceptor will go to this result by default, and if
configured as the default dispatcher result type, there won't be a redirect,
meaning nothing is lost. This also avoids action chaining, which isn't really
necessary for a one-step signup process.

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to