1 Reply Latest reply on Aug 20, 2010 12:26 AM by Claudio Miranda

    Injection inside HttpSessionAttributeListener

    Claudio Miranda Expert

      Hi folks,

      Is it possible to inject a seam component for  HttpSessionAttributeListener
      I want to inject a component loaded from components.xml into a HttpSessionAttributeListener implementation. The code looks like:

      MyInterface obj = (MyInterface) org.jboss.seam.Component.getInstance("obj", true);

      But there is an exception:

      java.lang.IllegalStateException: No application context active
              at org.jboss.seam.Component.forName(Component.java:1945)

      The listener declaration is after SeamListener in web.xml

      JBoss seam is 2.2.0
      JBoss 5.0

      If the injection is not officialy supported in seam, is there a workaround for this ?