We've now covered how to upgrade the version of JBoss Weld that is present within a Java EE container, such as JBoss AS7 and Glassfish, as well as how to use JBoss Weld as part of our application on a Servlet container, such as Apache Tomcat.
An important point to note here is how we bundled JBoss Weld into our application and added the servlet listener; they are not specific to Apache Tomcat. Those steps are applicable to all Servlet containers that implement the Servlet 2.5 specification or a more recent version of it.
The only aspect of bundling JBoss Weld for Apache Tomcat that will vary between Servlet containers is how the BeanManager
extension is attached to JNDI. If a Servlet container has a writable JNDI, JBoss Weld will handle it for us, but if it is a read-only JNDI such as Apache Tomcat, we will need a similar configuration to store the reference into JNDI.