Instead of making the developer add the Weld Servle listener in their web.xml when using weld-servlet, might we consider registering it for them automatically but including it in a web.xml fragment or TLD that&#39;s bundled in weld-servlet.jar? The benefit of using the TLD is that it would work in pre-Servlet 3.0 environments.<div>
<br></div><div>META-INF/web-fragment.xml</div><div><div>&lt;web-fragment xmlns=&quot;<a href="http://java.sun.com/xml/ns/javaee">http://java.sun.com/xml/ns/javaee</a>&quot;</div><div>    xmlns:xsi=&quot;<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>&quot;</div>
<div>    xsi:schemaLocation=&quot;<a href="http://java.sun.com/xml/ns/javaee">http://java.sun.com/xml/ns/javaee</a> <a href="http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd">http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd</a>&quot;</div>
<div>    version=&quot;3.0&quot;&gt;</div><div>   &lt;listener&gt;</div><div>      &lt;listener-class&gt;org.jboss.weld.environment.servlet.Listener&lt;/listener-class&gt;</div><div>   &lt;/listener&gt;</div><div>&lt;/web-fragment&gt;</div>
<div><br></div><div>META-INF/weld.tld</div><div><div>&lt;taglib xmlns=&quot;<a href="http://java.sun.com/xml/ns/javaee">http://java.sun.com/xml/ns/javaee</a>&quot;</div><div>    xmlns:xsi=&quot;<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>&quot;</div>
<div>    xsi:schemaLocation=&quot;</div><div>       <a href="http://java.sun.com/xml/ns/javaee">http://java.sun.com/xml/ns/javaee</a></div><div>       <a href="http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_0.xsd">http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_0.xsd</a>&quot;</div>
<div>    version=&quot;2.0&quot;&gt;</div><div>    &lt;description&gt;</div><div>       An empty tag library that registers a listener to bootstrap Weld in a Servlet container.</div><div>    &lt;/description&gt;</div><div>
    &lt;tlib-version&gt;1.0&lt;/tlib-version&gt;</div><div>    &lt;short-name&gt;w&lt;/short-name&gt;</div><div>    &lt;uri&gt;<a href="http://jboss.org/weld">http://jboss.org/weld</a>&lt;/uri&gt;</div><div><br></div><div>
    &lt;!--</div><div>       This ServletContextListener initializes the runtime environment of the CDI</div><div>       Reference Implementation (Weld) when a web application including it is</div><div>       initialized by the container.</div>
<div>    --&gt;</div><div>    &lt;listener&gt;</div><div>       &lt;listener-class&gt;org.jboss.weld.environment.servlet.Listener&lt;/listener-class&gt;</div><div>    &lt;/listener&gt;</div><div>&lt;/taglib&gt;</div></div>
<div><br></div><div>Btw, we are already including other automatic configurations, such as a JSF phase listener and view handler (META-INF/faces-config.xml).</div><div><br></div><div>Worthy of a JIRA?</div><div><br></div><div>
-Dan</div><br>-- <br>Dan Allen<br>Principal Software Engineer, Red Hat | Author of Seam in Action<br>Registered Linux User #231597<br><br><a href="http://mojavelinux.com" target="_blank">http://mojavelinux.com</a><br><a href="http://mojavelinux.com/seaminaction" target="_blank">http://mojavelinux.com/seaminaction</a><br>
<a href="http://www.google.com/profiles/dan.j.allen" target="_blank">http://www.google.com/profiles/dan.j.allen</a><br>
</div>