[jboss-jira] [JBoss JIRA] (WFLY-2611) Unify JSF action listener and CDI integration
Farah Juma (JIRA)
issues at jboss.org
Fri May 9 17:53:58 EDT 2014
[ https://issues.jboss.org/browse/WFLY-2611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12966583#comment-12966583 ]
Farah Juma edited comment on WFLY-2611 at 5/9/14 5:53 PM:
----------------------------------------------------------
Regarding the third way to specify an ActionListener:
{quote}
Defining in faces-config - in this case CDI injection works, but interceptor is not executed.
{quote}
When an ActionListener is defined in faces-config.xml, the ActionListener instance gets created using [Class clazz.newInstance|https://github.com/jboss/mojarra/blob/2.2.6-jbossorg-3/jsf-ri/src/main/java/com/sun/faces/config/processor/AbstractConfigProcessor.java#L270]. Injection still works in this case even though the ActionListener instance isn't managed by CDI because of the following Mojarra code that ensures that classes loaded from faces-config.xml are injectable:
https://github.com/jboss/mojarra/commit/41ef516ba983ef53889bb892496a2608f76db367
However, it looks like getting interceptors to work properly in this case depends on [JAVASERVERFACES-3142 | https://java.net/jira/browse/JAVASERVERFACES-3142].
was (Author: fjuma):
Regarding the third way to specify an ActionListener:
{quote}
Defining in faces-config - in this case CDI injection works, but interceptor is not executed.
{quote}
When an ActionListener is defined in faces-config.xml, the ActionListener instance gets created using [Class clazz.newInstance|https://github.com/jboss/mojarra/blob/2.2.6-jbossorg-3/jsf-ri/src/main/java/com/sun/faces/config/processor/AbstractConfigProcessor.java#L270]. Injection still works in this case even though the ActionListener instance isn't managed by CDI because of the following Mojarra code that ensures that classes loaded from faces-config.xml are injectable:
https://github.com/jboss/mojarra/commit/41ef516ba983ef53889bb892496a2608f76db367
However, it looks getting interceptors to work properly in this case depends on [JAVASERVERFACES-3142 | https://java.net/jira/browse/JAVASERVERFACES-3142].
> Unify JSF action listener and CDI integration
> ---------------------------------------------
>
> Key: WFLY-2611
> URL: https://issues.jboss.org/browse/WFLY-2611
> Project: WildFly
> Issue Type: Feature Request
> Security Level: Public(Everyone can see)
> Components: CDI / Weld, JSF
> Affects Versions: 8.0.0.CR1
> Reporter: Tomas Remes
> Assignee: Farah Juma
>
> There are three ways, how can user specify custom JSF action listener:
> 1. Method binding - with actionListener param. This case is ok, meaning CDI injection and interceptor works for given method/bean.
> 2. Providing custom implementation - <f:actionListener type="org.jboss.jsf.listeners.MyActionListener"/>. In this case CDI doesn't work at all for processAction method of given class.
> 3. Defining in faces-config - in this case CDI injection works, but interceptor is not executed.
> Reproducer available at https://github.com/tremes/javaee7-samples/tree/cdi-testing/jsf/actionlistener-injection. Test can be executed with "mvn clean test -Pwildfly-managed-arquillian" or "mvn clean test -Pwildfly-remote-arquillian" and IMHO all should pass.
>
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
More information about the jboss-jira
mailing list