From the course: Java EE 8 Essential Training

Unlock the full course today

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

CDI project setup

CDI project setup - Java EE Tutorial

From the course: Java EE 8 Essential Training

Start my 1-month free trial

CDI project setup

- [Instructor] In this lesson, we're going to configure our JSF project to support CDI, and then we're going to create our first bean. In order to configure our project to support CDI, just right click on it, then click on properties, and then within the project facets section, on the dialogue that pops up, you'll want to check CDI, and make sure you're using version 2.O which is the latest, and then just hit apply and close. And what you'll see happen is that, within your web.XML file, you'll get a Beans.XML file. Currently, we're set up as an implicit archive because we're only looking for annotated beans. Let's change over to an explicit archive by setting our bean discovery mode to all, and with this, we no longer need to annotate any of our classes in order to make them beans. They'll just automatically be created as a bean, when necessary, in the CDI container. We can close our beans.XML file, and now we can start…

Contents