When the form is posted back to Struts you need something which tells you which validation rules to use. Using the same form with different validation rules isn't a problem - if you compare the DynaValidatorForm with DynaValidatorActionForm the only difference is that the first uses the form name to find the validation rules and the second uses the action mapping's path. This is done in the validate method which is passed the Request and ActionMapping - all you need to do is have your own validate method which works out the which set of validation rules to pick up.
If you look at the latest versions of these forms in cvs (rather than Struts 1.1) it is much clearer as determining the key for the validation rules has been factored out into a separate method: getValidationKey(ActionMapping, HttpServletRequest) http://cvs.apache.org/viewcvs.cgi/jakarta-struts/src/share/org/apache/struts/validator/ Niall ----- Original Message ----- From: "superman" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, July 02, 2004 7:14 PM Subject: Associating different validation rules with same form > Pluggable Validation > > We are trying to implement a pluggable architecture by > defining DTOs, message resources and validations in a > jar file. A Plugin finder scans all the jar files > which are pluggable and loads them into the system. > Actions are generic and are defined in the core system > (dont ask why this complexity - essentially we want to > control the UI display but allow 3rd party vendors to > define view, validation and business objects) > > PROBLEM > > I decided to use Niall Pemberton > LazyValidatorActionForm as the action form because I > do not know abt the DTO properties in advance. > However, I am struggling to associate different > validation rules for different DTOs but using the same > form object. > > any ideas > A > > > > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 50x more storage than other providers! > http://promotions.yahoo.com/new_mail > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]