thanks - that made sense. BUT wasn't the source of the problem. I have found that my class needs to subclass org.apache.struts.validator.ValidatorForm (not ValidatorActionForm or ActionForm) in order for validation rules to be produced.
This now has the side-effect that my '@struts.form name=""' class javadoc declaration is not parsed (this seems to only be the case if the class extends ActionForm). Any clues as to a way round this? Matt -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Erik Hatcher Sent: 01 April 2004 15:31 To: [EMAIL PROTECTED] Subject: Re: [Xdoclet-user] can't generate validation.xml @struts.validator tags go on setters, not getters. It is the *setting* of the property that is to be validated :) Erik On Apr 1, 2004, at 8:54 AM, Matthew Hegarty wrote: > > Hi there > > I am trying but failing to generate the struts validation.xml file > using XDoclet (1.2). > I have the following defined in my struts-validation file > > <strutsvalidationxml > mergedir="${build.xdoclet.dir}/struts-validation"/> > > I have a source file which contains the method: > > /** > * Returns a String representation of the value. > * > * @struts.validator type="required" msgkey="query.required" > * > * @return The String value, maybe null. > */ > public String getSurname() { > return surname; > } > > I know that XDoclet is reading this file, because the form name is > generated Ok, and appears in struts-config.xml. > But the validation.xml generated is: > > <?xml version="1.0" encoding="ISO-8859-1" ?> > <!DOCTYPE form-validation PUBLIC "-//Apache Software Foundation//DTD > Commons Validator Rules Configuration 1.0//EN" > "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd"> > > <form-validation> > <!-- > This is a blank Validator form file with a commented examples. > --> > > <global> > > <!-- An example global constant > <constant> > <constant-name>postalCode</constant-name> > <constant-value>^\d{5}\d*$</constant-value> > </constant> > end example--> > > </global> > > <formset> > </formset> > </form-validation> > > Can anyone please advise on what I might be doing wrong? > I am using > Xdoclet 1.2 > Ant 1.6.1 > Java 1.4.0_01 > > many thanks > Matt > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > xdoclet-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/xdoclet-user ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
