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

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

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 2.1.2.Final
    • Fix Version/s: 2.2.0.CR1
    • Component/s: None
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      @Singleton
      public class ApplicationScopedBean

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

      Description

      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

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                jharting Jozef Hartinger
                Reporter:
                msevcenko Michal Ševčenko
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: