You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Pavel Sapozhnikov <pa...@gmail.com> on 2007/08/29 21:54:42 UTC

multi-page forms

In Struts1 you have the advantage to do create multi-page forms and validate
them too. Can you have the same effect in Struts2.

-- 
Pavel Sapozhnikov
xFact, Inc
pavel@xfact.com

Re: multi-page forms

Posted by Ted Husted <hu...@apache.org>.
Struts 2 uses a hierarchical approach to validation which could be
used to support a multi-page workflow. (Struts 1 simulates a hierarchy
by using the page property on the ActionForm.) The validation follows
the Java class, not the action mapping. If class2 extends class1, then
when class2 is validated, the validations for class1 also fire.

If you like to collect all the methods for a workflow into a single
class, then, in practice, class2 might be an empty class that only
exists to appease the XWork Validation system.

One thing Struts 2 doesn't support out of the box is storing input in
Session scope. We have to store a JavaBean with the properties we are
collecting there ourselves. To do that, look at

 * http://struts.apache.org/2.x/docs/accessing-application-session-request-objects.html

Depending on the back-end architecture, Model-Driven might also be useful

 * http://cwiki.apache.org/confluence/display/WW/Model+Driven+Interceptor

HTH, Ted
<http://www.husted.com/ted/blog/>

On 8/29/07, Pavel Sapozhnikov <pa...@gmail.com> wrote:
> In Struts1 you have the advantage to do create multi-page forms and validate
> them too. Can you have the same effect in Struts2.
>
> --
> Pavel Sapozhnikov
> xFact, Inc
> pavel@xfact.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org