[jsr-314-open-mirror] [jsr-314-open] CDI constructor integration

Ed Burns edward.burns at oracle.com
Tue Jun 29 14:37:58 EDT 2010


>>>>> On Thu, 24 Jun 2010 10:42:03 -0400, Stephen Kenna <kenna at us.ibm.com> said:

SK> We did some testing on Glassfish, and not only did constructor injection 
SK> not occur, but field injection did not occur either.  (Field injection is 
SK> working on JBoss)

Did you try putting the @Inject annotation on the field itself (not the
setter) and also putting the @javax.faces.bean.ManagedProperty
annotation on the field?

>>>>> On Sat, 26 Jun 2010 08:26:32 -0700, Pete Muir <pmuir at redhat.com> said:

SK> and we also need to support constructor injection 

PM> I'm pretty [sure] you don't. The @ManagedBean which causes the JSF
PM> managed bean container to get involved is *different* to the
PM> @ManagedBean which the EE spec indicates should support
PM> (javax.faces.bean.ManagedBean vs javax.annotation.Managed[Bean] -
PM> and yes, IMO this is a crazy divergence, and we did argue against
PM> it). 

This decision was driven by platform adoption more than anything else.
I decided it was important to support improverished (CDI-bereft)
containers like Tomcat 6 for JSF 2.0.

PM> Using this logic, there is *no way* for a managed bean which
PM> lives in the JSF managed bean container to become a managed bean as
PM> defined by EE.5.20, and thus support ctor injection. So, JSF managed
PM> beans are just required to support field injection.

PM> This is what we check in the CDI TCK.

PM> If you think about it, this makes sense. If you are in a CDI enabled
PM> bean archive, then why would you be using JSF managed beans. If you
PM> aren't in a CDI enabled bean archive, ctor injection is certainly
PM> not required.

Stephen, is this ok with you?

Ed

-- 
| edburns at oracle.com | office: +1 407 458 0017
| homepage:          | http://ridingthecrest.com/
| 13 Work Days Til JSF 2.1 Milestone 1



More information about the jsr-314-open-mirror mailing list