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>
/**
<XDtMethod:forAllMethodTags>
* <XDtMethod:methodTagValue/> <!-- Put matchValue logic here -->
</XDtMethod:forAllMethodTags>
*/
public <XDtMethod:methodType/>
<XDtMethod:getterMethod/>()<XDtMethod:exceptionList/>
{
return this.<XDtMethod:propertyName/>;
}
public void <XDtMethod:setterMethod/>( <XDtMethod:methodType/>
<XDtMethod:propertyName/> )
{
this.<XDtMethod:propertyName/> = <XDtMethod:propertyName/>;
}
</XDtStrutsForm:forAllFormFields>
But it doesn't like that:
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)
> -----Original Message-----
> From: Erik Hatcher [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, December 08, 2002 7:21 PM
> To: Matt Raible
> Cc: [EMAIL PROTECTED]
> Subject: Re: [Xdoclet-devel] Generating Validator Forms
>
>
> I might be the only living soul using <strutsvalidationxml>
> out there,
> but I probably won't be of much help since its hard to for me to put
> myself in your shoes and think of all this generation you're
> doing as it
> goes somewhat against the grain of my thinking.
>
> The reason I made the <strutsvalidationxml> task work only on
> ValidatorForm subclasses was because that was all I need and its also
> metadata that goes with the form and I don't think it belongs
> anywhere
> unless it needs to be tweaked on a per-client/customer/site basis.
>
> I'm assuming your POJO is a value-object, so now you're
> tagging it with
> view metadata. That just "smells" (in the Fowler sense) to
> me. I try
> to be judicious and carefully consider where metadata goes
> and putting
> validations on POJO's just doesn't seem like the proper fit.
>
> But, technically what you're after should work - have a look at
> <XDtMethod:methodTagValue> nested within a
> <XDtMethod:forAllMethodTags>.
>
> By all means keep me posted on what you end up with, as I'm
> curious to
> see how this all plays out - I'm not so set in my ways that I
> described
> above that I'm not open to learning new tricks if you come up with a
> good way of doing this :)
>
> Erik
>
>
>
> Matt Raible wrote:
> > I want to use the strutsform task to generate my validator forms for
> > struts. The current struts_form.xdt gives me most of what
> I need, save
> > the @struts.validator tags for each method. Is there a way
> to use the
> > struts.validator tag in my pojo (plain old java object) to
> generate the
> > same tag in my validator form?
> >
> > I'm thinking I would need to change the struts_form.xdt template:
> >
> > public void <XDtMethod:setterMethod/>( <XDtMethod:methodType/>
> > <XDtMethod:propertyName/> )
> > {
> > this.<XDtMethod:propertyName/> = <XDtMethod:propertyName/>;
> > }
> >
> > To contain some javadoc comments for the validator:
> >
> > <XDtConfig:ifPOJOContainsValidatorStuff>
> > * @struts.validator type="required" msgkey="label.required"
> > </XDtConfig:ifPOJOContainsValidatorStuff>
> >
> > Or even better, if I can grab the values from my pojo where it has:
> >
> > * @struts.validator type="required" msgkey="label.required"
> >
> > And my template will grab "required" and "label.required" like so:
> >
> > <XDtConfig:ifPOJOContainsValidatorStuff>
> > * @struts.validator type="${type}" msgkey="${msgkey}"
> > </XDtConfig:ifPOJOContainsValidatorStuff>
> >
> > Is this possible, or am I chasing a wild goose?
> >
> > Thanks,
> >
> > Matt
> >
>
-------------------------------------------------------
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