You can also validate based on the action rather than the form. Just use the
action type rather than the form name, and be sure to extend
ValidatorActionForm rather than ValidatorForm.

Dave Derry

----- Original Message -----
From: "bachan s" <[EMAIL PROTECTED]>


>
> Instead of writing different action forms you can have different entries
in your struts config with the same Object type (i.e action form ).In this
was you can have different rule for each form using the validator framework.
> Does this sound feasible.

>  Michael Lee <[EMAIL PROTECTED]> wrote:Along the same thread, we are
having a validation design problem.
> We have broken most of our Action classes up into multiple classes. Before
> we had one and used the property in the action mapping. That makes the
> Action classes much more readable.
> Problem is, these action classes still just use one ActionForm. This
> ActionForm's validation method checks the parameter because the validation
> for each page is different. This is starting to get large and unwieldy. I
> don't want to have to create basically the same ActionForm for each Action
> class when they are all mostly the same.
> Question is, what is a clean way of breaking up all these validations?
> Should I continue to check the action parameter and validate against it
> within the same validation method for that one Action form? I was thinking
> of extending the UserForm (the ActionForm in question) and just
implementing
> the validation method. This way I could also get rid of the parameter in
the
> action mapping of the struts-config.xml.
> Thanks,
> Mike
>



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>

Reply via email to