[cdi-dev] [JBoss JIRA] (CDI-572) support JSR-303 bean validation in CDI beans

Sven Linstaedt (JIRA) issues at jboss.org
Thu Nov 12 04:18:00 EST 2015


    [ https://issues.jboss.org/browse/CDI-572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13128077#comment-13128077 ] 

Sven Linstaedt commented on CDI-572:
------------------------------------

Something like {{javax.enterprise.inject.InvalidResolutionException}} ?

Seriously one can also argue for validation annotations being qualifiers, so ambigous beans for injection point may exists as along as exactly one of them passes validation. Which ultimately renders injection point validation being a runtime validation, not performable a bootstrap time.

> support JSR-303 bean validation in CDI beans
> --------------------------------------------
>
>                 Key: CDI-572
>                 URL: https://issues.jboss.org/browse/CDI-572
>             Project: CDI Specification Issues
>          Issue Type: Epic
>            Reporter: Mark Struberg
>
> Consider a bean like 
> {code}
> @SessionScoped
> public class CurrentUser {
>   @javax.validation.constraint.NotNull
>   @javax.validation.constraint.Length(10)
>   private String userId;
>   ...
> }
> {code}
> We could easily check this and invoke JSR-303 (if available) in the Producer<T>. Please note that for a custom Producer they have to care for it themselves.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the cdi-dev mailing list