I definitivly like the @ValidationMethod better, but you can do something
like this:

protected final int MAX_VALUE = 9999;

@Validate(required = true, minvalue = 1900, maxvalue = MAX_VALUE)
private int birthyear;

{
    MAX_VALUE = Calendar.getInstance().get(Calendar.YEAR);
}

or

protected final int MAX_VALUE = 9999;

@Validate(required = true, minvalue = 1900, maxvalue = MAX_VALUE)
private int birthyear;

public BaseActionBean() {
    MAX_VALUE = Calendar.getInstance().get(Calendar.YEAR);
}

Cheers,

--
Samuel Santos
http://www.samaxes.com/


2010/9/7 Grzegorz Krugły <g...@karko.net>

>  Don't know if it can be done with @Validate, but it can be done with
> @ValidationMethod, just takes a bit more work.
>
>
> http://www.stripesframework.org/display/stripes/Validation+Reference#ValidationReference-CustomValidation
>
> HTH,
> Grzegorz
>
>
>
> ------------------------------------------------------------------------------
> This SF.net Dev2Dev email is sponsored by:
>
> Show off your parallel programming skills.
> Enter the Intel(R) Threading Challenge 2010.
> http://p.sf.net/sfu/intel-thread-sfd
> _______________________________________________
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to