Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
JSF pioneered the concept of “managed beans” in web applications. However, JSF managed beans are fairly limited. JSR 299 (“Contexts and Dependency Injection”, often abbreviated as CDI) defines a more flexible model for beans that are managed by the application server. These beans are bound to a context (such as the current request, a browser session, or even a user-defined life cycle context). CDI specifies mechanisms for injecting beans, intercepting and decorating method calls, and firing and observing events. Because CDI is a much more powerful mechanism than JSF managed beans, it makes sense to use CDI beans if you deploy your application in a Java EE application server. A Java EE 6 compliant application server, such as GlassFish, automatically supports CDI.