5 Replies Latest reply on Apr 25, 2006 5:33 PM by rmaucher

    Servlet 2.5 injection control

    starksm64

      For the dependency inject stuff, jboss has to have control over this. We need a lifecycle callback that allows for the injection of the references after the servlet has been created, but before its init method is called.

        • 1. Re: Servlet 2.5 injection control
          rmaucher

          Yes, I thought I would add listeners too, but there are lots of places which need injection (it gets really ugly in the JSP layer, as tag instances need injection too), so I used a utility class to inject which does lookups from the local JNDI context (with support for all the annotations that are supposed to be supported right now). I didn't see any reason why this wouldn't work with JBoss.

          • 2. Re: Servlet 2.5 injection control
            starksm64

            What is the jndi name being used? There may be a default value, but I believe this is going to have to be configurable by jboss specific metadata as well.

            • 3. Re: Servlet 2.5 injection control
              rmaucher

              There is a default JNDI name, of course, and can be overridden using the name field in the annotation. There's also a mappedName field in each annotation (I am not using it right now). So you'd like to be able to override all these annotation mappings using a deployment descriptor as well ?

              • 4. Re: Servlet 2.5 injection control
                starksm64

                I believe we need that, and there is also the restoration of the annotation metadata from cached sources such as the virtual filesystem of the deployment to avoid having to parse the class/deployment descriptors again.

                • 5. Re: Servlet 2.5 injection control
                  rmaucher

                  Then I believe the best will be to (eventually) take the Tomcat code and do a little surgery.