I was able to get the strutsvalidatorxml to work with commons-validator by making the
following change in the StrutsValidatorTagsHandler class. Probably a "better" way to
do this is to add a parameter to the strutsvalidationxml task such as :
<strutsvalidationxml commons-validator="true"/>
Then checking that property (if possible) in this method.
public void forAllForms(String template, Properties attributes) throws
XDocletException
{
Collection classes = getAllClasses();
for (ClassIterator i = XCollections.classIterator(classes); i.hasNext(); ) {
XClass currentClass = i.next();
setCurrentClass(currentClass);
if (DocletSupport.isDocletGenerated(getCurrentClass()) ||
(getCurrentClass().isAbstract())) {
continue;
}
//if (TypeTagsHandler.isOfType(currentClass,
"org.apache.struts.validator.ValidatorForm", TypeTagsHandler.TYPE_HIERARCHY)) {
generate(template);
//}
}
}
my validator.xml from this has something like:
<field property="currentAddress1"
depends="required,max-length">
<arg0 key="com.MyClass.currentAddress1"/>
<var>
<var-name>max-length</var-name>
<var-value>32</var-value>
</var>
</field>
i'm not sure if the arg0 will effect anything, i'll have to do some testing...
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.532 / Virus Database: 326 - Release Date: 10/27/2003
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user