Apache Tomcat 7/8

Overview

Apache Tomcat? is an open source software implementation of the Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket technologies. The Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket specifications are developed under the Java Community Process.

Dependencies

Ocelot Framework use massively cdi. So ocelot need cdi implementation for worked.
Tomcat do not use CDI implementation, so we have to add one. We choose to add Weld implementation as is describe on weld site.
TomEE use an other CDI implementation OpenWebBean, so it's probably possible to use it.
Moreever we have to add json-p api and implementation.

WAR Module

<!-- IN WEB MODULE -->
<!-- OCELOT -->
<dependency>
   <groupId>org.ocelotds</groupId>
   <artifactId>ocelot-web</artifactId>
   <version>${ocelot.version}</version>
</dependency>
<dependency>
   <groupId>org.ocelotds</groupId>
   <artifactId>ocelot-core</artifactId>
   <version>${ocelot.version}</version>
</dependency>
<!-- END OCELOT -->
<!-- JSONP -->
<dependency>
   <groupId>javax.json</groupId>
   <artifactId>javax.json-api</artifactId>
   <version>1.0</version>
</dependency>
<dependency>
   <groupId>org.glassfish</groupId>
   <artifactId>javax.json</artifactId>
   <version>1.0.4</version>
</dependency>
<!-- END JSONP -->
<!-- WELD -->
<dependency>
   <groupId>org.jboss.weld.servlet</groupId>
   <artifactId>weld-servlet-core</artifactId>
   <version>2.2.14.Final</version>
</dependency>
<!-- END WELD -->

Configuration

CDI is not native in Tomcat, so we have to bootstrap it in the Web archive

WAR Module

In web.xml

<!-- WELD -->
<listener>
   <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
</listener>
<resource-env-ref>
   <resource-env-ref-name>BeanManager</resource-env-ref-name>
   <resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-env-ref-type>
</resource-env-ref>-->
In context.xml

<!-- WELD -->
<Resource name="BeanManager" auth="Container" type="javax.enterprise.inject.spi.BeanManager" factory="org.jboss.weld.resources.ManagerObjectFactory"/>