One approach is to have more than one ActionMapping leading to the same
Action. To instatiate the form, use a mapping with validate=false, to
insert or update the form, use a mapping with validate=true.
So you might have one mapping to "myActionClass" (with validate false)
and another to "myActionClassSave" (with validate true), but both would
point to the same myActionClass.
I believe the example application does something like this.
-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/
flare wrote:
>
> that's a classic portal problem, I've built a container based form
> autentication, the user log in then can edit his profile, I want to
> use the same ActionClass I use for registration so I have a link that
> points to:
> myActionClass.do?action=edit
> inside the actionclass I've a bean that (when action=edit) fetches
> the user data from a db then populate the actionform and points back
> to the input form.
> The problem is that when the framework instantiates the actionform
> (since it doesn't exist), it fills the action field bean and
> suddendly calls the validate method so I got an error page instead of
> the populated edit form!
> Which is the correct way to handle this?
>
> Fla'