From the course: Java EE: Contexts and Dependency Injection

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

CDI configuration and use

CDI configuration and use

From the course: Java EE: Contexts and Dependency Injection

Start my 1-month free trial

CDI configuration and use

- [Narrator] To use CDI, you need to specify its dependency. If you're using Maven to manage your project, you can add the entire range of Java EE technologies with the following single Maven coordinates. If you want to use CDI in a Java SE application, then you will need the reference implementation provided by Weld. You should always use the latest versions of the dependencies, and at the time of recording, these were the most recent versions. The versions relate to CDI 2.0, which was released in Java EE 8. There are currently two CDI implementations available. Jboss Weld, which is the Reference Implementation, And Apache OpenWebBeans. Several IPs provide CDI extensions, such as Apache DeltaSpike, and Jboss Seam, among others. You will also need to switch on the bean discovery. The bean discovery process occurs during application deployment. The container finds classes that conform to the requirements of a CDI bean, and instantiates them. They are then put under the management of…

Contents