[jboss-user] [EJB3] - Re: EJB3 and Struts2 with CDI (question)

rop do-not-reply at jboss.com
Fri Apr 8 05:22:40 EDT 2011

rop [http://community.jboss.org/people/rop] created the discussion

"Re: EJB3 and Struts2 with CDI (question)"

To view the discussion, visit: http://community.jboss.org/message/598755#598755

...or just read this:  :) 

Didnt get EJB3 dependency-injection to work with Struts2 action-classes.

The main difference to a plain servlet, is that the action-classes in Struts2
are created on-the-fly (new myActionclass()) everytime a request comes in,
and @EJB doesnt work for such classes.

Currently, as a work-around, I just do jndi context-lookup to get the EJB3 instead.

But I read somewhere that CDI should be able to handle this. 
Is that correct?

Any input still appreciated!


Reply to this message by going to Community

Start a new discussion in EJB3 at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110408/946a8676/attachment.html 

More information about the jboss-user mailing list