On 6/22/05, Mark Galbreath <[EMAIL PROTECTED]> wrote: > Validator is crap...and always has been. If you look in the archive, you > will see more complaints about Validator working over the past 3 years and > any other 2 subjects combined.
<OT> Risking to start offtopic here, I would say that the whole idea of validation on web layer does not look right for me. Some quick pre-validation makes sense right on a client using Javascript, like field is empty or numeric field contains letters. This saves time and bandwidth. But validating input on web layer is imho not proper, because: * my app can have several front ends besides Struts or I will upgrade (umm-umm) from Struts to something else, but I have same rules for input data, so why should validation be called from Struts form bean? * On the similar note, I may use a universal component, which is self-contained. No use for Struts validation here. * My Business/Persistence layers have their own rules, so the request still may fail. Why not then to stick _everyting_ in the backend for consistency? So, validate() in a form bean is just a convenience method for very simple cases, when Struts is the only front end, and there is no much validation on the backend. Another convenience of validate() is that it is called after fields were populated, but before (or instead) action class, so I can stick whatever post-processing I want into it. It should be called postProcess() or postPopulate() (ugh, POST is a request method type) afterPopulate() or something. </OT> Just came from the lunch, recharged ;) Michael. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]