struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Cook" <>
Subject RE: [Struts 2 + EJB 3] injection of EJBs into struts 2 actions
Date Fri, 04 Dec 2009 11:58:19 GMT
EJB's can only be injected into other EJB's or Servlets, a struts 2
action is essentially a pojo not a servlet. So you would either have to
do a lookup in the context, or if you are using Spring look at using a
jndi lookup and inject that reference into your class.


-----Original Message-----
From: Fernandes Celinio [] 
Sent: 04 December 2009 11:37
Subject: [Struts 2 + EJB 3] injection of EJBs into struts 2 actions

I know that it is not possible to inject EJB in Struts 2 actions.
The following annotation would not work :
MyBeanLocal mybean;
But how come ? Since a Struts action is a servlet and injection works in
a servlet, injection should work.
Thanks for enlightening me.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message