Uploaded image for project: 'CDI Specification Issues'
  1. CDI Specification Issues
  2. CDI-117

Add BeanManager to a ServletContext attribute

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Duplicate
    • Minor
    • None
    • 1.0
    • Java EE integration
    • None
    • Documentation (Ref Guide, User Guide, etc.), Compatibility/Configuration
    • Low

    Description

      CDI 1.0 defines a JNDI lookup as the standard way to obtain the BeanManager for resources not managed by the CDI environment. However in a servlet environment it would be much easier to get the BeanManager from a standardized servlet context attribute. This would be also a major simplification in environments that don't support JNDI (for example GAE) or that don't allow to use the standard JNDI name for the BeanManager (for example Apache Tomcat).

      This topic was already discussed on weld-dev about a year ago [1]. Weld 1.0 already supports this [2] and OpenWebBeans also added this feature [3]. Unfortunately Weld 1.1 changed the attribute to a Weld-specific name in [4] which currently leads to much confusion [5].

      As both of the major CDI implementations support this feature I think it should finally be put into the spec.

      [1] http://lists.jboss.org/pipermail/weld-dev/2010-March/002359.html
      [2] https://issues.jboss.org/browse/WELD-202
      [3] https://issues.apache.org/jira/browse/OWB-360
      [4] https://jira.jboss.org/browse/WELD-679
      [5] http://seamframework.org/Community/GettingBeanManagerFromServletContextWithWeld11

      Attachments

        Issue Links

          Activity

            People

              pmuiratbleepbleep Pete Muir (Inactive)
              christian@kaltepoth.de Christian Kaltepoth
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: