FWIW, according to the book "professional site programming" which I
started to read recently, the recommended design pattern is to do
"basic" validation in the ActionForm (is a number, is a date), and the
more business-oriented validation in the Action (is a positive smaller
than 10, is a date AD).

Ted should be able to correct me on this :)
tomK


> -----Original Message-----
> From: Dick Starr [mailto:[EMAIL PROTECTED]] 
> Sent: woensdag 23 januari 2002 21:46
> To: struts-user
> Subject: Should all validation be done in the Action class 
> instead of the ActionForm class?
> 
> 
> I'm new to web apps / struts and wanting know if there is any 
> performance
> reason to do initial validation in the ActionForm class (via
> validate="true"). It seems to me that all validation should 
> be done in the
> Action class since then all the validation is in one section 
> of code and
> since the Action class gets called anyway. Also, I heard that 
> there are
> tools to automatically generate the ActionForm classes, which might be
> another argument to not stick any additional code in them (in 
> case you want
> to re-generate them). Just wondering ...
> 
> Thanks,
> 
> Dick Starr
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:struts-user-> [EMAIL PROTECTED]>
> For 
> additional commands, 
> e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 

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

Reply via email to