CDI

  • Beitrags-Autor:
  • Beitrags-Kategorie:Internet

https://tomcat.apache.org/tomcat-10.1-doc/cdi.html + OpenWebBeans in Tomcat 10+ + https://jakarta.ee/specifications

pom.xml

<dependency>
    <groupId>org.apache.openwebbeans</groupId>
    <artifactId>openwebbeans-jsf</artifactId>
    <version>4.0.2</version>
</dependency>
<dependency>
    <groupId>org.apache.openwebbeans</groupId>
    <artifactId>openwebbeans-el22</artifactId>
    <version>4.0.2</version>
</dependency>

/META-INF/context.xml

<Context>
    <Resource name="BeanManager" 
        auth="Container"
        type="jakarta.enterprise.inject.spi.BeanManager"
        factory="org.apache.webbeans.container.ManagerObjectFactory" />
</Context>

/WEB-INF/web.xml (before Jakarta Faces)

<listener>
    <listener-class>org.apache.webbeans.servlet.WebBeansConfigurationListener</listener-class>
</listener>

/WEB-INF/beans.xml (empty file, not in META-INF)


Pavel Pscheidl wrote this post and published a demo.