myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Koci <martin.k...@aura.cz>
Subject Re: evaluating JSR-303 @Size(max=) for input fields?
Date Tue, 24 Aug 2010 20:59:04 GMT

Hi,

I tried it for my renderkit but unfortunately there is no (or I didn't
find) solution for scenario, where 

value="#{bean.otherBean.constrainedProperty}" and otherBean is null. In
such case you can only obtain constrains from declared type, not from
the real one. 

But for simpler cases where value EL leads to property on non-null bean
it works fine and reduces  duplicity of "max length" information. JPA
2.0 uses @Size for DB constraints too.

Regards,

Martin Kočí

Mark Struberg píše v Út 24. 08. 2010 v 20:41 +0000:
> Hi!
> 
> Not sure if this is covered in the spec, but wouldn't if be useful to parse for 
> the JSR-303 Size annotation [1] and use this value for the maxlength attribute 
> of h:inputText fields if nothing is manually specified in the xhtml?
> 
> LieGrue,
> strub
> 
> 
> [1]http://download.oracle.com/javaee/6/api/javax/validation/constraints/Size.html
> 
> 
>       
> 



Mime
View raw message