You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beehive.apache.org by bo...@codehaus.org on 2004/11/13 00:06:40 UTC

@Jpf.ValidateFOO hints?

Howdy--

Still hacking on the Jpf annotations doc, and have gotten to the
@Jpf.ValidateFoo annotations.  A quick grep of the repo for Validate
doesn't seem to turn up any examples.  Can someone point me in the
right direction?  I've got the feeling they work on ValidatableBeans
or on forms, but I'm not quite sure.

Thanks,

	-bob

Re: @Jpf.ValidateFOO hints?

Posted by Carlin Rogers <ca...@bea.com>.
Hi Bob,

Yes, they are for forms and validatable form beans.

They are the annotations are for declarative validation support
and map to the commons-validator used to generate the required
validator XML (See the commons-validator DTD).

So for example, the following annotations,
     ValidateRequired
     ValidateMinLength
     ValidateMaxLength
     ValidateMask
     ValidateType
     ValidateDate
     ValidateRange
     ValidateCreditCard
     ValidateEmail
     ValidateValidWhen
     ValidateCustomVariable
     ValidateCustom
map to the standard built in validations for Struts.
(See http://struts.apache.org/userGuide/dev_validator.html)

A bean property can then have various validation rules applied
to it using these annotations as well as defining attributes
about the locale, and message, etc.

There are some of Page Flow tests with validation that might also help.
netui/test/webapps/drt/coreWeb/miniTests/variantValidation/Controller.jpf
netui/test/webapps/drt/coreWeb/miniTests/validateField/Controller.jpf
However, these are really geared towards specific test scenarios and
may not be great for examples.

Hope this gets you started.
kind regards,
Carlin

bob@codehaus.org wrote:

> Howdy--
> 
> Still hacking on the Jpf annotations doc, and have gotten to the
> @Jpf.ValidateFoo annotations.  A quick grep of the repo for Validate
> doesn't seem to turn up any examples.  Can someone point me in the
> right direction?  I've got the feeling they work on ValidatableBeans
> or on forms, but I'm not quite sure.
> 
> Thanks,
> 
> 	-bob
>