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

Dora Rajappan commented on MYFACES-3786:
----------------------------------------

Unable to apply this patch and verify how this works. I analysed the patch.
CDIAnnotationInjectionProvider class has this 
public void inject(Object instance) throws InjectionProviderException
    {
AnnotatedType annoType = beanManager.createAnnotatedType(instance.getClass());
        InjectionTarget target = beanManager.createInjectionTarget(annoType);
        target.inject(instance, beanManager.createCreationalContext(null));

ExternalArtifactResolver for Validator Converter has this and this gave 
problems with the constructor created instances.
 Bean<?> bean = beanManager.resolve(beans);
 CreationalContext<?> creationalContext = 
beanManager.createCreationalContext(bean);

        @SuppressWarnings({ "unchecked", "UnnecessaryLocalVariable" })


        T result = (T) beanManager.getReference(bean, type, creationalContext);

Its good CDIAnnotationInjectionProvider inject can solve the problem of 
constructor created instances not getting resolved from BeanManager using 
ExternalArtifactResolver.
And this should take care of CDI from jsf.

2.2 spec says container will take care of injection similar to managed beans. 
Hence you have made specific coding for Tomcat to find if tomcat has injected 
the artifacts if not create the instances in jsf. Have to make it generic for 
supporting rest of the containers.


> Web Container injection support should be provided for additional lifecycle 
> artifacts (not just managed beans)
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-3786
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3786
>             Project: MyFaces Core
>          Issue Type: Task
>          Components: JSR-344
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>         Attachments: cdiELresolverWeb.zip, cdiELResolver.zip, 
> cdiPartialViewContext.war, cdiPartialViewContext.zip, cdi.patch, 
> cdiphaselistener1.patch, cdiphaselistener2.patch, cdiValidatorSource.zip, 
> cdiValidator.war, MYFACES-3786-1.patch
>
>
>  This issue is all about how to inject beans into jsf artifacts.
> See JSF 2.2 section 5.4.1
> The problem here is in some point we need to give the control to the 
> underlying environment to inject beans into the artifacts, but we don't know 
> much about how to properly do it, so we need to try with examples.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to