Contexts and dependency injection (CDI) for the Java™ EE platform is an implementation
based on the JSR 299 specification. You can create applications that
implement CDI in your Java EE
projects.
CDI applications are activated by the presence of a beans.xml file
that exists in the WEB-INF directory of a web archive (WAR), or in
the META-INF directory of other types of archives, as defined by the
JSR 299 specification. When activated, the container provides services
such as:
- Context management
- Type-safe dependency injection: A CDI-managed bean is instantiated
and injected as needed.
- Decorators, which implement one or more bean interfaces and can
contain business logic. Decorators are disabled by default. You can
have multiple decorators per bean and order is defined by the beans.
- Interceptor bindings. Interceptors, which are enabled manually
in the beans.xml file, are bound using an interceptor binding type.
- Event model
- Integration into JavaServer Faces (JSF) and JavaServer Pages (JSP)
files using the Expression Language (EL)
For more information about the CDI annotations, see Package javax.inject.
For more information about using CDI in WebSphere® Application Server, see Contexts and Dependency Injection (CDI).