Title: Message
Cool. Does it support aliases? Just as a heads up, I'm going to be changing the file names when I add the visitor field validator... actually, if you're not building alias validators, it won't change... it's just changing for alias validation files, from aliasName-validation.xml to ClassName-aliasName-validation.xml to allow for many different classes to be validated with the same alias name..
 
Jason
-----Original Message-----
From: Brock Bulger [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 22, 2003 6:28 PM
To: [EMAIL PROTECTED]
Subject: [OS-webwork] xdoclet module

There was interest earlier on the list for an XDoclet module to automatically generate the XWork *-validation.xml files. I've put together a module that you can use in your XWork/WebWork2 projects. The attached zip file contains the module jar file, an example class marked up with tags and the generated validation.xml file.
 
Here is an example of the tag usage:
 
/**
 * @xwork.field name="created"
 * @xwork.field-validator.required message="created is a required field."
 * @xwork.field-validator.date-range
 *      min="12-22-2002"
 *      max="12-25-2002"
 *      message="The date must be between 12-22-2002 and 12-25-2002."
 */
 private Date created;
 
To add this to your build process add the following task (or similar) to your build.xml file:
 
<target name="generate" depends="setenv">
    <taskdef
        name="xworkdoclet"
        classname="xdoclet.modules.xwork.XWorkDocletTask"
        classpathref="classpath"
    />
 
    <xworkdoclet
        destdir="${build.dest}"
        excludedtags="@version,@author"
    >
        <fileset dir="${java.dir}">
            <include name="**/*.java"/>
        </fileset>
 
        <xwork />
    </xworkdoclet>
</target>
 
You will need to add the xdoclet-xwork-module-1.2b4.jar file along with the xdoclet-1.2b4.jar file to your build env classpath.
 
Feedback is appreciated.
 
- Brock

Reply via email to