Title: Generating Validator Forms

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

Reply via email to