You have one ActionForm class in your whole system? If that's the case then that's your main problem. The rule is one ActionForm per logical html form the user sees.

It sounds like you used to have only one Action as well but split it up. That's what you should do with the forms.

David






From: "Michael Lee" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: Re: Validator later rather than sooner?
Date: Thu, 24 Oct 2002 14:52:30 -0400

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


----- Original Message -----
From: "Richards, Devin N (Devin)" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, October 24, 2002 1:58 PM
Subject: RE: Validator later rather than sooner?


> Since the validator classes extend the standard struts classes, I would
get everything working correctly and then add the validator in after. We did
this and it worked well (except for the current bug of the validator not
supporting multiple resource bundles.)
>
> -Devin
>
>
> -----Original Message-----
> From: Susan Bradeen [mailto:SusanB@;softlanding.com]
> Sent: Thursday, October 24, 2002 1:50 PM
> To: [EMAIL PROTECTED]
> Subject: Validator later rather than sooner?
>
>
> Is it general practice, or recommended, to develop a Struts application
> using the Action/ActionForm classes first (getting everything working
> properly) and later switch to the Validator classes, OR to use the
> Validator classes (implementing validation) right from the beginning?
>
> I have done a little with form validation, but not enough to know if I
> will get myself in trouble by waiting and "switching" class sets later on.
>
> Thanks,
> Susan Bradeen
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>
>

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

_________________________________________________________________
Broadband? Dial-up? Get reliable MSN Internet Access. http://resourcecenter.msn.com/access/plans/default.asp


--
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