2 Replies Latest reply on Sep 20, 2009 11:28 PM by genman

    Injecting bean instances in Servlets/EJBs

    genman

      Looked over the documentation but I didn't really see any explanation or recommendation for how deployed beans are supposed to be accessed through Servlet deployments. Is JNDI the suggested way? Is there support for @javax.annotation.Resource tags for accessing your own beans? (I wonder how JBoss AS implements @Resource...)

      JNDI might be okay. If so, how can I be sure the Servlet is initialized AFTER my bean is?

      I guess I'm really after something like what Web Beans promises, which is integration of POJOs/dependency injection with JEE.

      As an aside, I don't really see any code sharing between Microcontainer, Seam/Web Beans, which is odd, considering the functionality is in many ways similar.