Configuring Liberty for Contexts and Dependency Injection 1.2
You can configure Liberty for the Contexts and Dependency Injection (CDI) 1.2 feature, which provides full support for the Contexts and Dependency Injection 1.2 specification.
About this task
Procedure
Update the server.xml file to add the <cdi-1.2>
feature. For example:
<featureManger>
<feature>cdi-1.2</feature>
</featureManger>
Note:
- You can use other Java™ EE 7 features, such as jsp-2.3 and jsf-2.2 with the cdi-1.2 feature. However, you cannot use Java EE 6 features such as jsp-2.2 and jsf-2.0 with the cdi-1.2 feature.
- You can choose between the CDI 1.0 and CDI 1.2 feature implementations for each server instance, but you must consider the behavior changes. If the behavior is only contained in the CDI 1.2 feature, then you must use the CDI 1.2 feature. If an existing application might be adversely affected by behavior changes in the CDI 1.2 feature, then use the CDI 1.0 feature to preserve the existing behavior for that application.
- It is not possible to use both the CDI 1.0 and CDI 1.2 features in the same Liberty server. If both features are configured, it produces an error. Read the CDI 1.2 behavior changes topic to learn about changes from CDI 1.0 to CDI 1.2.