Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-1621

WELD-000710: Cannot inject ServletContext outside of a Servlet request

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 2.2.0.CR1
    • 2.1.2.Final
    • None
    • None
    • Hide

      @Singleton
      public class ApplicationScopedBean

      { @Inject private ServletContext ctx; ... }
      Show
      @Singleton public class ApplicationScopedBean { @Inject private ServletContext ctx; ... }

      Is it correct that the ServletContext can be injected only into request-scoped beans? IMO ServletContext by nature is an application-scoped object.

      Also this spec says that ServletContext is application-scoped bean:
      http://docs.jboss.org/seam/3/servlet/latest/reference/en-US/html/injectablerefs.html#injectablerefs.servlet_context

              rhn-engineering-jharting Jozef Hartinger
              msevcenko Michal Ševčenko (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: