myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: @BeanValidation annotation at class level
Date Fri, 19 Oct 2012 10:38:09 GMT
Hi Gerhard,

thanx for quick response. I tracked down the problem that the Annotation (@BeanValidation)
is not available on objectToInspect.getClass() in ExtValBeanValidationMetaDataInternals#transferGroupValidationInformationToFoundGroups.

objectToInspect.getClass() returns a bytecode enhanced proxy class (...Dlg_$$_javassist_85)
where I can see only the @RequestScoped Annotation from CDI. Besides @BeanValidation also
the @Named Annotation from CDI is missing.
I don't know if this behavior of a byte code proxy is correct!? I would expect that at least
Annotations from Retention CLASS and RUNTIME are also available on the proxies.

I also wonder a little why ExtValBeanValidationMetaDataInternals#processClass does not use
the classToInspect (Unproxied Class) to gather the Annotations. If this method would pass
classToInspect instead of objectToInspect to the #transferGroupValidationInformationToFoundGroups
everything should be fine.

Any help with this issue is appreciated!

-----Urspr√ľngliche Nachricht-----
Von: Gerhard Petracek [] 
Gesendet: Donnerstag, 18. Oktober 2012 21:49
An: MyFaces Discussion
Betreff: Re: @BeanValidation annotation at class level

hi manuel,

you can check it in ExtValBeanValidationMetaDataInternals#
(see #inspectFirstBean (= class level), #inspectFirstProperty, #inspectBaseOfProperty (= class
level) and #inspectLastProperty)


Your JSF/JavaEE powerhouse -
JavaEE Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

2012/10/18 <>

> Hello MyFaces ExtVal users,
> I've a question regarding group validation together with 
> @BeanValidation annotation. In my example the @BeanValidation 
> annotation only works on page bean fields. On class level it seems that the annotation
is ignored.
> This works:
> @BeanValidation(useGroups=IUiGroupStage2.class)
>     private String wmc;
> This doesn't work:
> @BeanValidation(useGroups=IUiGroupStage2.class)
> public class HomeDlg implements Serializable {
> The following documentation states that it should be possible to 
> declare the annotation at class level:
> But now how can I make it run? Is there some configuration to be done?
> Thanx in advance!
> Manuel

View raw message