anchor.diff:  While CDI does not require support for servlet environments, Weld can be
   used in a servlet container, such as Tomcat or Jetty.
   
  -NOTE: There is a major limitation to using a servlet container. Weld doesn't
  +NOTE: There is a major limitation to using a servlet container; Weld doesn't
   support deploying session beans, injection using `@EJB`
   or`@PersistenceContext`, or using transactional events in servlet
   containers. For enterprise features such as these, you should really be
   looking at a Java EE application server.
   
   Weld can be used as a library in an web application that is deployed to
  -a Servlet container. You should place `weld-servlet-shaded.jar` within the
  -`WEB-INF/lib` directory relative to the web root. `weld-servlet-shaded.jar` is
  -an "uber-jar", meaning it bundles all the bits of Weld and CDI required
  -for running in a Servlet container, for your convenience. Alternatively,
  -you can use its component jars. A list of transitive dependencies can be
  -found in the `META-INF/DEPENDENCIES.txt` file inside the
  -`weld-servlet-shaded.jar` artifact.
  -
  -You also need to explicitly specify the servlet listener (used to boot
  -Weld, and control its interaction with requests) in WEB-INF/web.xml in
  -the web root:
  +a Servlet container. You should add the `weld-servlet-core` as a dependency
  +to your project:
  +
  +[source.XML, xml, subs="normal"]
  +<dependency>
  +    <groupId>org.jboss.weld.servlet</groupId>
  +    <artifactId>weld-servlet-core</artifactId>
  +    <version>{weldVersion}</version>
  +</dependency>
  +
  +All the necessary dependencies (CDI API, Weld core) will be fetched transitively.
  +
  +Alternatively, there is a shaded version with all the dependencies in a single
  +jar file which is available as:
  +
  +[source.XML, xml, subs="normal"]
  +<dependency>
  +    <groupId>org.jboss.weld.servlet</groupId>
  +    <artifactId>weld-servlet-shaded</artifactId>
  +    <version>{weldVersion}</version>
  +</dependency>
  +
  +In general, weld-servlet uses link:http://docs.oracle.com/javaee/7/api/javax/servlet/ServletContainerInitializer.html[ServletContainerInitializer]
  +mechanism to hook into the life cycle of Servlet 3.x compatible containers.
  +
  +In special cases when your Servlet container does not support `ServletContainerInitializer`
  +or you need more control over the ordering of listeners (e.g. move Weld's listener)
  +to the beginning of the list so that CDI context are active during invocation of other listeners)
  +you can register Weld's listener manually in the `WEB-INF/web.xml` file of the application:
   
   [source.XML, xml]
   -------------------------------------------------------------------------------
  
positive.code:    <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
  </listener>
  -------------------------------------------------------------------------------
  
  Actually, you don't have to register this listener in Servlet 3.x
  compliant containers which support
  `javax.servlet.ServletContainerInitializer` service properly (e.g.
  Tomcat 7.0.50). In this case
  `org.jboss.weld.environment.servlet.EnhancedListener` will do all the
  necessary work automatically, and what is more important - injection
  into Listeners will work on some containers as well (see <<_tomcat>> and <<_jetty>> for
  more info).
  
  The downside of `javax.servlet.ServletContainerInitializer` approach is
  that the Weld listener will be added to the end of the ordered list of
  discovered listeners. In practice the request and session context will
  not be active during `ServletRequestListener` and `HttpSessionListener`
  notifications. Fortunately, it's possible to combine the
  `EnhancedListener` and the old `Listener` to fix this problem - simply
  add the old `Listener` to the `web.xml` as mentioned above. Note that it
  must be defined before the listeners using request and session context.
  
  NOTE: There is quite a special use-case where one more special component must
  be involved. If you want the session context to be active during
  
negative.code: 
  ==== Tomcat
  
  Since version 2.2.0.Final only Tomcat 7 and 8 are supported by Weld.
  By simply adding `weld-servlet` you get Tomcat integration automatically.
  
  Weld automatically supports context activation/deactivation and dependency
  injection into Servlets and Filters. Injection into Servlet listeners works on
  Tomcat 7.0.50 and newer.
  
  ===== Binding BeanManager to JNDI
  
  What does not work out of the box is binding BeanManager to JNDI.
  Tomcat has a read-only JNDI, so Weld can't automatically bind the
  BeanManager extension SPI. To bind the BeanManager into JNDI, you should
  populate `META-INF/context.xml` in the web root with the following
  