Thanks Michael, both of those are helpful.

I have a few extra questions though:

Regarding ActionDispatcher -
* The ParameterListActionDispatcher class isn't in the 1.2.8 struts
distribution that I downloaded, and is linked as a bugfix. Do I need
to download the entire struts source, add this in and recompile, or is
there an easier way?

Regarding DataEntryForm -
* In sections 6 & 7 it describes a class
ParameterMappingDispatchAction that I also don't see in the
distribution (nor in the javadocs online). Is this referring to the
ParameterListActionDispatcher class or something else? Conceptually it
seems to be describing the same thing. If not is there an example of
what step 7 is describing?

All that aside, when I turn off automatic validation, can I still call
the validation manually in my action code? ie. Something like :

ActionErrors errors = form.validate(mapping, request);
if (!errors.isEmpty()) {
    // determine which forward key to use based upon which step I am
in the process
    forward = mapping.findForward(forwardKey);
    saveErrors(request, errors);
    return forward;
}

Is there anything else I need to do to validate the form manually?

Thanks

Chris


On 3/2/06, Michael Jouravlev <[EMAIL PROTECTED]> wrote:
> On 3/2/06, Chris Cheshire <[EMAIL PROTECTED]> wrote:
> > I want to set up a form that is entered over 3 successive pages.
> >
> > I have a single form bean for all of them that includes all of the
> > fields, and the validate method only validates the fields that were
> > implemented on each particular step.
> >
> > Step 2 will present 1 of 2 sub-forms, depending on an option selected
> > on the bottom of form 1 (ie, either enter credit card info, or bank
> > account info).
> >
> > I was thinking of using a DispatchAction to process each step and move
> > to the next part of the form sequence, but my problem is with
> > automatic validation and the struts-config declarations. I can only
> > declare one input per action, so if validation fails on any step the
> > controller would always redirect back to that specified input page  -
> > which might not be the one the user was on.
> >
> > Do I actually need to set up multiple actions each with their own
> > input and process the steps through there or is there a way I can do
> > this with a single DispatchAction?
> >
> > Or better yet, can I set validation to false in struts-config and then
> > call the validation routine myself inside the action and then forward
> > back to the correct input page if it fails?
>
> Do not use automatic validation, it prevents your action class from
> being called if validation fails. See these pages for a start:
> http://wiki.apache.org/struts/ActionDispatcher
> http://wiki.apache.org/struts/DataEntryForm
>
> Michael.

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

Reply via email to