I waited to the end to add some validation stuff to my project which is following the BaseBeans framework. The BaseBeans approach likes to use one Dispatch action as much as possible for related tasks (which I like to as well). The problem is with the "New" Dispatch. Now I remember why in my apps I usually have a separate setUpAction for dealing with the "New" population of a form. The problem is that if BaseBean is going to extend ValidatorForm (and not ValidatorActionForm), you will run into problems if your intial form has invalid initial properties that don't match validation since the associated formBean will be validated if validation is set to true. The way I like to get around this is to have a separate action mapping with validation set to false for going to the form for an initial entry ("Dispatch=New"). Of course this means you have to have an extra Action mapping for all your forms in the struts config file. If you don't like this approach another option which "might" work is to have BaseBean extend ValidatorActionForm but this will force all your validations to map to particular actions (vs being tied to the form beans) which I think will cause a lot of redundant stuff in the validation.xml file. Plus I'm not sure how it works with Dispatch paramaters (I assume it would work but haven't tried).

--
Rick
_______________________________________________
MVC-Programmers mailing list
[EMAIL PROTECTED]
http://www.basebeans.net:8080/mailman/listinfo/mvc-programmers

Reply via email to