[jira] [Commented] (MYFACES-4130) CDI @ManagedProperty does not work with all types

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[jira] [Commented] (MYFACES-4130) CDI @ManagedProperty does not work with all types

My Faces - Dev mailing list

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

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

Thanks for the help committing Eduardo!


> 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)
Loading...