Summary
In this chapter, we provided an introduction to Contexts and Dependency Injection (CDI). We covered how JSF pages can access CDI named beans as if they were JSF managed beans. We also covered how CDI makes it easy to inject dependencies into our code via the @Inject
annotation. Additionally, we explained how we can use qualifiers to determine which specific implementation of a dependency to inject into our code. Finally, we covered all the scopes that a CDI bean can be placed into, which include equivalents to all the JSF scopes, plus an additional two not included in JSF, namely, the conversation scope and the dependent scope.