<font size=2 face="sans-serif">We have internally been discussing @Inject
into @ManagedBeans (should be the same for JSF Managed beans defined in
the faces-config.xml).</font>
<br>
<br><font size=2 face="sans-serif">Originally we were trying to figure
out if JSF managed beans should support constructor injection if they were
inside a BDA (in other words, if JSF should defer to CDI for creation).</font>
<br>
<br><font size=2 face="sans-serif">We did some testing on Glassfish, and
not only did constructor injection not occur, but field injection did not
occur either. (Field injection is working on JBoss)</font>
<br>
<br><font size=2 face="sans-serif">My reading of JSR-299 & the EE6
spec differs from this. </font>
<br>
<br><font size=2 face="sans-serif">From JSR299 Section 1.2.1:</font>
<br><font size=2 face="sans-serif"><i>In the Java EE 6 environment, all
component classes supporting injection, as defined by the Java EE 6 platform
specifica-</i></font>
<br><font size=2 face="sans-serif"><i>tion, may inject beans via the dependency
injection service.</i></font>
<br>
<br><font size=2 face="sans-serif">Or JSR299 Section 3.8:</font>
<br><font size=2 face="sans-serif"><i>An injected field is a non-static,
non-final field of a bean class, or of any Java EE component class supporting
injection.</i></font>
<br>
<br><font size=2 face="sans-serif">From the EE6 spec, Section EE.5.20 states:</font>
<br>
<br><font size=2 face="sans-serif"><i> Per the CDI specification,
dependency injection is supported on managed</i></font>
<br><font size=2 face="sans-serif"><i>beans. There are currently three
ways for a class to become a managed bean:</i></font>
<br><font size=2 face="sans-serif"><i> 1. Being an EJB session bean
component.</i></font>
<br><font size=2 face="sans-serif"><i> 2. Being annotated with the
@ManagedBean annotation.</i></font>
<br><font size=2 face="sans-serif"><i> 3. Satisfying the conditions
in Section 3.1 of the CDI specification.</i></font>
<br><font size=2 face="sans-serif"><i> Classes that satisfy
at least one of these conditions will be eligible for full</i></font>
<br><font size=2 face="sans-serif"><i>dependency injection support, as
described in CDI.</i></font>
<br>
<br><font size=2 face="sans-serif">and </font>
<br>
<br><font size=2 face="sans-serif"> <i>Clearly, in the
absence of any additional annotations, most component classes</i></font>
<br><font size=2 face="sans-serif"><i>listed in Table EE.5-1 will not be
managed beans. So as to make injection support</i></font>
<br><font size=2 face="sans-serif"><i>more uniform across all component
types, Java EE containers are required to</i></font>
<br><font size=2 face="sans-serif"><i>support field or method injection
(but not constructor injection) using</i></font>
<br><font size=2 face="sans-serif"><i>@javax.inject.Inject on all component
classes listed in Table EE.5-1 when the</i></font>
<br><font size=2 face="sans-serif"><i>containing archive is a bean archive.</i></font>
<br><font size=2 face="sans-serif"><i> </i></font>
<br><font size=2 face="sans-serif">Our interpretation of the above is that
we definitely need to support field injection of @Inject into @ManagedBean
beans, and we also need to support constructor injection </font>
<br>
<br><font size=2 face="sans-serif">What are other's interpretation?</font>
<br><font size=2 face="sans-serif"><br>
<br>
Regards,<br>
Stephen<br>
</font>