A switch is reasonable, but I think it needs to disable more than just annotation-defined managed beans support. My understanding is that a JSF managed bean defined in faces-config.xml can still have a @PostConstruct annotation that gets processed (same with the other life cycle annotations and the @EJB annotation). Then it's still possible that there is an instance of an application-scoped eager bean in the JSF managed bean container. Same would go for beans in other scopes.<br>
<br>We should state that it's possible to inject a managed or enterprise bean into a JSF managed bean because the injection, as you said, is based on the EL. If the injection goes the other way, the instance is the one created by JSR-299 and not the instance created by JSF; an important point to understand. Therefore, there could be two instances of a bean per scope. And from what you proposed, the JSR-299 bean always wins if it has the same name as a JSF managed bean.<br>
<br>-Dan<br><br><div class="gmail_quote">On Sun, Aug 2, 2009 at 6:38 PM, Pete Muir <span dir="ltr"><<a href="mailto:pmuir@redhat.com">pmuir@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi<br>
<br>
I realized we have a potential conflict between JSF and 299 to do with<br>
EE defined managed beans, which we need to address. Imagine the<br>
following scenario: A managed bean is defined using @ManagedBean in a<br>
war in which both JSF and Web Beans is enabled. In this case both JSF<br>
and Web Beans will attempt to manage the bean, however according to<br>
the latest note sent by Roberto Chinnici to the EE expert group, if<br>
299 is present, 299 should manage the bean. We need to address how to<br>
deal with this for both Web Beans and Mojarra.<br>
<br>
Some points to consider:<br>
<br>
* 90% of the time there is no problem, the Web Beans ELResolver is<br>
installed before the JSF ManagedBeanELResolver. However the corner<br>
case of an eager instantiated, application scoped managed bean with a<br>
post construct lifecycle callback will cause us a problem. There may<br>
also be other corner cases we haven't considered. For this reason, I<br>
think we should consider being able to explicitly disable JSF managed<br>
beans<br>
* this doesn't affect other specs which may use managed beans as much,<br>
(a) as Mojarra works in other containers than GlassFish, such as<br>
Tomcat, where Web Beans may not be present<br>
(b) 299 specifically states that JSF should use an ELResolver as<br>
it's integration point (other specs integration point is programatic<br>
and so can use an SPI if or similar - Ken's suggestion from our latest<br>
meeting for those who were there)<br>
* Mojarra will need to continue to provide xml-defined managed beans<br>
when Web Beans/299 is present.<br>
<br>
My suggested solution is to simply have a switch in Mojarra we can use<br>
to "turn off" annotation-defined managed beans support (either<br>
automatic via detection of WEB-INF/beans.xml or manual via web.xml or<br>
programatically).<br>
<br>
Pete<br>
<br>
On 31 Jul 2009, at 20:11, Barbara Louis wrote:<br>
<br>
> - How we deal with jsf managed beans when 299 is present?<br>
> - 299 requires managed beans<br>
> - JSF RI will need to make the change - the ques to ask is: should<br>
> jsf manage the managed beans or should I let the EE container to<br>
> manage it for me?<br>
> - Pete will send an email on webbeans dev mailing list on this topic<br>
> and include Mojarra mailing list (<a href="mailto:webtier@glassfish.dev.java.net">webtier@glassfish.dev.java.net</a>)<br>
<br>
_______________________________________________<br>
webbeans-dev mailing list<br>
<a href="mailto:webbeans-dev@lists.jboss.org">webbeans-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/webbeans-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/webbeans-dev</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Dan Allen<br>Senior Software Engineer, Red Hat | Author of Seam in Action<br>Registered Linux User #231597<br><br><a href="http://mojavelinux.com">http://mojavelinux.com</a><br>
<a href="http://mojavelinux.com/seaminaction">http://mojavelinux.com/seaminaction</a><br><a href="http://in.relation.to/Bloggers/Dan">http://in.relation.to/Bloggers/Dan</a><br>