myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Andraschko (JIRA)" <...@myfaces.apache.org>
Subject [jira] [Commented] (MYFACES-4130) CDI @ManagedProperty does not work with all types
Date Mon, 14 Aug 2017 12:10:01 GMT

    [ https://issues.apache.org/jira/browse/MYFACES-4130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16125590#comment-16125590
] 

Thomas Andraschko commented on MYFACES-4130:
--------------------------------------------

JFY: Your commit breaks my applications as you included a EL-Impl without the right scope.
I changed the scope and looks better now.

> CDI @ManagedProperty does not work with all types
> -------------------------------------------------
>
>                 Key: MYFACES-4130
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4130
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-372
>    Affects Versions: 2.3.0-beta
>            Reporter: Paul Nicolucci
>            Assignee: Eduardo Breijo
>             Fix For: 2.3.0
>
>         Attachments: MYFACES-4130.patch, MYFACES-4130-with-test.patch
>
>
> CDI Replacement for @ManagedProperty does not work with primitives, 
> ParameterizedType or arrays.
> For example:
> @Inject
> @ManagedProperty("#{testBean.list}")
> private List<String> listManagedProperty;
> javax.faces.FacesException: java.lang.ClassNotFoundException: java.util.List<java.lang.String>
> 	at org.apache.myfaces.shared.util.ClassUtils.simpleClassForName(ClassUtils.java:218)
> 	at org.apache.myfaces.cdi.bean.DynamicManagedPropertyProducer.<init>(DynamicManagedPropertyProducer.java:58)
> 	at org.apache.myfaces.cdi.bean.ManagedPropertyExtension.afterBean(ManagedPropertyExtension.java:62)
> @Inject
> @ManagedProperty("#{testBean.number}")
> private int numberManagedProperty;
> javax.faces.FacesException: java.lang.ClassNotFoundException: int
> 	at org.apache.myfaces.shared.util.ClassUtils.simpleClassForName(ClassUtils.java:218)
> 	at org.apache.myfaces.cdi.bean.DynamicManagedPropertyProducer.<init>(DynamicManagedPropertyProducer.java:58)
> 	at org.apache.myfaces.cdi.bean.ManagedPropertyExtension.afterBean(ManagedPropertyExtension.java:62)
> @Inject
> @ManagedProperty("#{testBean.stringArray}")
> private String[] stringArrayManagedProperty;
> javax.faces.FacesException: java.lang.ClassNotFoundException: java.lang.String[]
> 	at org.apache.myfaces.shared.util.ClassUtils.simpleClassForName(ClassUtils.java:218)
> 	at org.apache.myfaces.cdi.bean.DynamicManagedPropertyProducer.<init>(DynamicManagedPropertyProducer.java:58)
> 	at org.apache.myfaces.cdi.bean.ManagedPropertyExtension.afterBean(ManagedPropertyExtension.java:62)
> I've attached a patch. If no objections by Wednesday close of business I'll commit it.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message