1 Reply Latest reply on Apr 8, 2011 5:24 AM by rop

    EJB3 and Struts2 with CDI (question)

    rop Newbie

      Just realized I forgot to mark my last thread as a question (does it matter?).

       

      It's here:

       

         http://community.jboss.org/thread/164928?tstart=0

        • 1. Re: EJB3 and Struts2 with CDI (question)
          rop Newbie

          ...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 with annotations.

          Is that correct?

           

          Any input still appreciated!

           

          Thanx,