The short answer - You have to do the lookup yourself.

The long answer - There's a similar discussion going on that pretty
much covers the topic:
http://www.nabble.com/Struts2-Action-Class-and-EJB-Injection-td24497801.html

Nils-H

On Thu, Jul 16, 2009 at 10:03 PM, Nathan Schulte<nathan.schu...@ngc.com> wrote:
> This may be more related to XWork2, but I'll start by asking here.
>
> I'm creating a custom Interceptor to handle user permissions for an 
> application.
>  Rather than redirecting to an action to actually process a login attempt
> (requiring a custom result type), the Interceptor itself will process the 
> login
> attempt.  However, in order for this to work, the Interceptor needs access to 
> a
> session bean that is the interface to the persistence layer.
>
> Is it possible to use the Java EE 5 @EJB annotation to inject an EJB, or even
> the Inject EJB Plugin?  I've tried both, and neither seem to work (both result
> in a null object reference).  I realize I can use a JNDI lookup to get a
> reference to the bean, but I would much rather use injection if possible, as
> that's why it's there.
>
> Thanks!
> -Nate
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to