How to configure Tomcat 7 for JSF 2.0 - CDI (Context & Dependency Injection) and JBoss - JSF Video Tutorial

http://www.youtube.com/watch?v=q30ICO30FGsendofvid [starttext] This is a Video Tutorial explains So, how do you use the JSR299 annotations in a JSF 2.0 application that's going to be deployed to Tomcat 7? Well, by default, Tomcat 7 does not support JSR-299, the CDI (Context and Dependency Injection) specification. So, to support JSR-299 in your Tomcat deployed web apps, you need to do a little work. One option is to download the MyFaces CODI implementation. The other is to include the JBoss/SeamFramework's implementation of JSR-299, which is better known as "Weld."

This tutorial shows you how to get the required Weld libraries, configure your web.xml file with the required listener, set up the beans.xml file, and do all of the other stuff that's needed to configure Weld in a JSF application that's going to be deployed to servlet engine like Tomcat.

Oh, and just so you know, you do need the beans.xml file if you're working with Weld, even if there is really no content in the file. If you leave it out, you'll run into a runtime exception.

[endtext]

Check out this stream