Addendum to Micah's answer; CDI is not only useful in combination with JSF because of the support for injection, but also because of its support, which must be used with EL (expression language). This feature of JSF is highly dependent on.
In fact, CDI beans can almost completely replace JSF managed beans, and so you will find many examples using them, and a large number of JSF books that advise you to use them. For JSF applications, CDI beans have, for example, the following advantages:
- May introduce smaller areas to larger areas. For instance. GET request parameters with the request can be entered into the bean session zone. This is not possible with JSF managed beans.
- Can use the conversation area; An area that spawns several different pages.
It is unfortunate that in JSF 2.0 and 2.1 the extremely convenient viewing area is not supported by default CDI beans, although extensions such as Seam can add them. (update: in JSF 2.2 there is a new viewport that works with CDI beans)
In general, the confusion between JSF Managed beans and CDI beans is such that there is a JSF specification for it, see http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-976
source share