2 Replies Latest reply on Apr 10, 2011 4:39 PM by djheisterberg

    EJB3 and Struts2 with CDI ?

    rop

      Hi,

       

      I asked a question in the EJB3 forum some days ago, but got 0 answers.

      So I try to ask here, too --- still need help, please:

       

           http://community.jboss.org/thread/164928

       

       

      ... or just read this:

       

       

      rop wrote:

       

      Still 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 Dependency-Injection in POJOs created on-the-fly....

      Is that correct?

       

      Any input still appreciated!

       

      Thanx,