You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jason Chaffee <Ja...@metatv.com> on 2001/04/30 18:31:31 UTC

RE: Where to forward when validate returns false in wizard style forms?

Yes, it would be better to have an action for each step in the process.
That is what MVC/Model 2 is all about.

-----Original Message-----
From: Seth Ladd [mailto:seth@brivo.com]
Sent: Monday, April 30, 2001 8:33 AM
To: struts-user@jakarta.apache.org
Subject: Where to forward when validate returns false in wizard style
forms?


Hello,

I may not understand properly the way struts deals with things when
validate="true" in the action mapping, so please bear with me.

I have a wizard style input form(s) all using the same Action.  Most of the
time, the Action will only forward to the next page.  Only at the last page
will the Action perform its work.

I want to take advantage of struts' automatic validation of FormBeans.  I
believe, if I set validate="true", then if validate returns false, struts
will automatically forward back to the input page (as specified by the input
attribute of the action-mapping element).  It seems that this will not work
properly for a wizard style approach.  This is because the input page
changes for every step in the wizard process.

Has anyone else dealt with this problem?  Do I have to manually perform the
validation myself inside the Action?  Would it be better to just have an
Action for every step in the wizard process?

Thanks for any tips or pointers,
Seth


Seth Ladd | Software Engineer, Product Development
Brivo Systems, Inc.
seth@brivo.com

Confidential and Proprietary, Brivo Systems, Inc.


RE: Where to forward when validate returns false in wizard style forms?

Posted by Seth Ladd <se...@brivo.com>.
> Yes, it would be better to have an action for each step in the process.
> That is what MVC/Model 2 is all about.

Thanks for the reply!  That's the same conclusion I came to.  What I'm
trying is having the same Action class handle each step, since for the
wizard style all but the last step only forward to the next phase.  I am
using validate="true" so if the user has an error, struts will forward back
to the input page.  So my single Action class just checks forward to "next"
for all but the last step.

Next I'm going to learn about the token functionality.

Thanks very much,
Seth