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.
version="3.0">
<listener>
<listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
</listener>
</web-fragment>
META-INF/weld.tld
xsi:schemaLocation="
version="2.0">
<description>
An empty tag library that registers a listener to bootstrap Weld in a Servlet container.
</description>
<tlib-version>1.0</tlib-version>
<short-name>w</short-name>
<!--
This ServletContextListener initializes the runtime environment of the CDI
Reference Implementation (Weld) when a web application including it is
initialized by the container.
-->
<listener>
<listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
</listener>
</taglib>
Btw, we are already including other automatic configurations, such as a JSF phase listener and view handler (META-INF/faces-config.xml).
Worthy of a JIRA?
-Dan
--
Dan Allen
Principal Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597
http://mojavelinux.comhttp://mojavelinux.com/seaminaction
http://www.google.com/profiles/dan.j.allen