Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: [s2] Struts Dependency Injection and EJB3 - support ? or how can i Do it?

Craig R. McClanahan

2007-01-22

Replies:

On 1/22/07, Paris Apostolopoulos <papo@(protected):
>
> [snip]
> I wonder the @EJB annotations are not going to work (I guess). I had a
> look @ some glassfish FAQ..



The standard annotations for Java EE 5 resource injection are indeed *not*
going to work on a Struts action, because they only work on
container-created objects (servlets, filters, listeners, and JSF managed
beans). You'll want to look at a custom interceptor solution (as described
in this thread), continuing to use JNDI lookups, or perhaps using an
alternative resource injection framework like Spring.

Craig
©2008 junlu.com - Jax Systems, LLC, U.S.A.