Chapter 4. Learning Context and Dependency Injection

We saw that Chapter 3, Introducing Java EE 7 – EJBs, was challenging since we had to cover lots of ground, including Java Enterprise enhancements and a Maven-specific configuration. In this chapter, we'll discuss Contexts and Dependency Injection (CDI), which was added to the Java EE specification in Java EE 6 (starting from JSR 299). It provides several benefits to Java EE developers that were missing, such as allowing any JavaBean to be used as a JSF managed bean, including stateless and stateful session beans. You can find more information on CDI and the newest version of the specification itself (JSR 346) at http://www.cdi-spec.org/.

Some of the topics that will be covered in this chapter ...

Get Java EE 7 Development with WildFly now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.