struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Reumann <>
Subject Re: Wouldn't validation be better performed by Actions rather than ActionForms?
Date Fri, 18 Mar 2005 19:16:21 GMT
Lawrie Gallardo wrote the following on 3/18/2005 12:17 PM:

> Now if this is the case, would it not be better to have the ActionForm 
> as basically a dum data holder and have the validation method in the 
> Action classes instead? The strus-config.xml file could contain all the 
> required declarative validation, transformation and mapping info, and 
> the Action class could contain any validation, transformation, and 
> mapping operations that were too complicated to be set up declaratively.

I agree totally and I call my validation from my Action classes. Example 
here (at the end)

(Note in that example, I call the form's validate method from my Action, 
but I only do that in the example to show that it can be done and to 
keep it simple. In practice I think it's much better to not even do the 
validation in the ActionForm's validate method - even if you are just 
invoking that method from elsewhere.)


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message