+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"><<a href="mailto:dan.j.allen@gmail.com">dan.j.allen@gmail.com</a>></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'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><web-fragment xmlns="<a href="http://java.sun.com/xml/ns/javaee" target="_blank">http://java.sun.com/xml/ns/javaee</a>"</div><div> xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"</div>
<div> xsi:schemaLocation="<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>"</div>
<div> version="3.0"></div><div> <listener></div><div> <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class></div><div> </listener></div><div></web-fragment></div>
<div><br></div><div>META-INF/weld.tld</div><div><div><taglib xmlns="<a href="http://java.sun.com/xml/ns/javaee" target="_blank">http://java.sun.com/xml/ns/javaee</a>"</div><div> xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"</div>
<div> xsi:schemaLocation="</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>"</div>
<div> version="2.0"></div><div> <description></div><div> An empty tag library that registers a listener to bootstrap Weld in a Servlet container.</div><div> </description></div><div>
<tlib-version>1.0</tlib-version></div><div> <short-name>w</short-name></div><div> <uri><a href="http://jboss.org/weld" target="_blank">http://jboss.org/weld</a></uri></div><div>
<br></div><div>
<!--</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> --></div><div> <listener></div><div> <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class></div><div> </listener></div><div></taglib></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>"Keep it Simple"<br>