I got this to work By using the following forAllMethodTags syntax:
/**
<XDtMethod:forAllMethodTags tagName="struts.validator">
* @struts.validator <XDtMethod:methodTagValue
tagName="struts.validator"/>
</XDtMethod:forAllMethodTags>
*/
I tried many other variations for a few hours (good ol' trial and error)
and this was the only one that worked. To allow all the
struts.validator tags to come through, I had to add a forAll for each
one.
/**
<XDtMethod:forAllMethodTags tagName="struts.validator">
* @struts.validator <XDtMethod:methodTagValue
tagName="struts.validator"/>
</XDtMethod:forAllMethodTags>
<XDtMethod:forAllMethodTags tagName="struts.validator-args">
* @struts.validator-args <XDtMethod:methodTagValue
tagName="struts.validator-args"/>
</XDtMethod:forAllMethodTags>
<XDtMethod:forAllMethodTags tagName="struts.validator-var">
* @struts.validator-var <XDtMethod:methodTagValue
tagName="struts.validator-var"/>
</XDtMethod:forAllMethodTags>
*/
One thing I did discover, which makes sense, if that you have to put
these on top of the SETTER methods, or they won't come through - as
validation only occurs on setting.
I've attached my modified struts_form.xdt that I'm using.
Matt
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]] On Behalf
> Of Erik Hatcher
> Sent: Monday, December 09, 2002 7:11 AM
> To: Matt Raible
> Cc: [EMAIL PROTECTED]
> Subject: Re: [Xdoclet-devel] Generating Validator Forms
>
>
> Matt Raible wrote:
> > Are you suggesting that I do something like this (see below). This
> > sounds like it would work, and maybe I could use matchValue of
> > something to detect validator tags?
> >
> >
> > <XDtStrutsForm:forAllFormFields>
>
> Is this the same (or similar) forAllFormFields() method that
> I wrote in
> my strutsgen? Is it calling setCurrentMethod()?
>
> > /**
> > <XDtMethod:forAllMethodTags>
> > * <XDtMethod:methodTagValue/> <!-- Put matchValue
> logic here -->
> > </XDtMethod:forAllMethodTags>
> > */
>
> I haven't dug under the covers of forAllMethodTags, but I'm
> assuming it
> keys off the current method.
>
> > ejbdoclet] (XDocletMain.start 51 )
> Running XDoclet
> > failed.
> > ejbdoclet] (XDocletMain.start 52 )
> <<Running XDoclet
> > failed.>>
> > ejbdoclet] xdoclet.template.TemplateException: Invoking method in
> > class xdoclet.tagshandler.MethodTagsHandler failed: m thodTagValue,
> > line=4 of template file:
> > file:/D:/source/appfuse/metadata/templates/struts_form.xdt,
> exception:
> > null
> > ejbdoclet] at
> >
> xdoclet.template.TemplateEngine.invokeMethod(TemplateEngine.java:523)
>
> Maybe start logging things to dig deeper. Its always a challenge to
> debug these things, I find. And it just takes some time to
> fiddle with
> it to find out what its not getting that it wants.
>
> Erik
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Xdoclet-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/xdoclet-devel
>
struts_form.xdt
Description: Binary data
