+1, at least makes life easier for folks who are on 3.0 already.<br><br>JIRA it.<br><br><div class="gmail_quote">On Thu, Oct 7, 2010 at 1:40 PM, Dan Allen <span dir="ltr">&lt;<a href="mailto:dan.j.allen@gmail.com">dan.j.allen@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">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" target="_blank">http://java.sun.com/xml/ns/javaee</a>&quot;</div><div>    xmlns:xsi=&quot;<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>&quot;</div>

<div>    xsi:schemaLocation=&quot;<a href="http://java.sun.com/xml/ns/javaee" target="_blank">http://java.sun.com/xml/ns/javaee</a> <a href="http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd" target="_blank">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" target="_blank">http://java.sun.com/xml/ns/javaee</a>&quot;</div><div>    xmlns:xsi=&quot;<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">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" target="_blank">http://java.sun.com/xml/ns/javaee</a></div><div>       <a href="http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_0.xsd" target="_blank">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" target="_blank">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>
<br>_______________________________________________<br>
weld-dev mailing list<br>
<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br></blockquote></div><br><br clear="all"><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.com">http://ocpsoft.com</a><br>
<a href="http://scrumshark.com">http://scrumshark.com</a><br>&quot;Keep it Simple&quot;<br>