Install Guide for Servlet Containers

The simplest way to get started with MVC is to deploy your app to a JavaEE 8 application server. In this setup the application server will provider JAX-RS, CDI and BeaƄ Validation implemnetations for you. Please refer to Install Guide for Java EE for details about this setup.

However, there is a large number of users who prefer to run their applications on plain Servlet containers like Apache Tomcat and Jetty. In this setup you will have to provider JAX-RS, CDI and Bean Validations yourself.

In this guide we will show you how to run Ozark on Apache Tomcat using Weld, RESTEasy and Hibernate Validator.

The MVC specification and Ozark are under active development. Therefore, we recommend to use the latest snapshots for your experiments. This will ensure, that you are using the latest version of both the API and the implementation. Please refer to Using the latest snapshots to learn more.

Required dependencies

The following pom.xml example shows the dependency configuration for your application:

<!-- Get the API JARs for Java EE 8 -->

<!-- Weld  -->

<!-- RESTEasy -->

<!-- Bean Validation -->

<!-- MVC + Ozark for RESTEasy-->

Configuration files

Make sure to add an empty beans.xml file in your /src/main/webapp/WEB-INF folder:

<?xml version="1.0"?>
<beans xmlns=""
       version="2.0" bean-discovery-mode="all">


Please also add a file called context.xml to src/main/resources/META-INF:

<?xml version="1.0" encoding="UTF-8"?>

   <Resource name="BeanManager" auth="Container"


This file context.xml is essential for the operation of the CDI in Tomcat as described in the Weld documentation.

The file to create is called web.xml and should be placed in the src/main/webapp/WEB-INF directory:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi=""



  <!-- -->


That’s all. Now you can start developing your first MVC 1.0 application.