myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Nicolucci (JIRA)" <...@myfaces.apache.org>
Subject [jira] [Commented] (MYFACES-4130) CDI @ManagedProperty does not work with all types
Date Tue, 01 Aug 2017 17:24:00 GMT

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

Paul Nicolucci commented on MYFACES-4130:
-----------------------------------------

Fixed some check style issues in the patch and attached to the issue again.


> 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: Paul Nicolucci
>         Attachments: MYFACES-4130.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