@@ -5,4 +5,100 @@ template: page.html
5
5
6
6
## Install Guide for Servlet Containers
7
7
8
- TODO
8
+ The Ozark MVC implementation is based on Jersey and recently a RestEasy module has been added to work with Widlfly.
9
+
10
+ In this guide we will run Ozark on Apache Tomcat using the RestEasy module
11
+
12
+ The following pom.xml example that shows the dependency configuration:
13
+
14
+ ### Apache Tomcat
15
+
16
+ ``` xml
17
+ <dependency >
18
+ <groupId >javax.mvc</groupId >
19
+ <artifactId >javax.mvc-api</artifactId >
20
+ <version >1.0-SNAPSHOT</version >
21
+ </dependency >
22
+ <dependency >
23
+ <groupId >org.mvc-spec.ozark</groupId >
24
+ <artifactId >ozark-resteasy</artifactId >
25
+ <version >1.0.0-m03-SNAPSHOT</version >
26
+ </dependency >
27
+ <dependency >
28
+ <groupId >javax</groupId >
29
+ <artifactId >javaee-web-api</artifactId >
30
+ <version >7.0</version >
31
+ </dependency >
32
+ <dependency >
33
+ <groupId >org.jboss.weld.servlet</groupId >
34
+ <artifactId >weld-servlet-core</artifactId >
35
+ <version >2.4.3.Final</version >
36
+ </dependency >
37
+ <dependency >
38
+ <groupId >org.jboss.resteasy</groupId >
39
+ <artifactId >resteasy-cdi</artifactId >
40
+ <version >3.1.4.Final</version >
41
+ </dependency >
42
+ <dependency >
43
+ <groupId >org.jboss.resteasy</groupId >
44
+ <artifactId >resteasy-servlet-initializer</artifactId >
45
+ <version > 3.1.4.Final</version >
46
+ </dependency >
47
+ <dependency >
48
+ <groupId >org.hibernate</groupId >
49
+ <artifactId >hibernate-validator</artifactId >
50
+ <version >5.4.1.Final</version >
51
+ </dependency >
52
+ ```
53
+ ### 3. Add the bean.xml,context.xml and web.xml file
54
+ make sure to add an empty beans.xml file in your /resources/META-INF folder to your Web project:
55
+
56
+ ``` xml
57
+ <?xml version =" 1.0" ?>
58
+ <beans xmlns =" http://xmlns.jcp.org/xml/ns/javaee"
59
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
60
+ xsi : schemaLocation =" http://xmlns.jcp.org/xml/ns/javaee
61
+ http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
62
+ version =" 1.1" bean-discovery-mode =" all" >
63
+ </beans >
64
+ ```
65
+ still in the same folder add the context.xml with the following content:
66
+
67
+ ``` xml
68
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
69
+ <Context >
70
+ <Manager pathname =" " />
71
+ <Resource name =" BeanManager"
72
+ auth =" Container"
73
+ type =" javax.enterprise.inject.spi.BeanManager"
74
+ factory =" org.jboss.weld.resources.ManagerObjectFactory" />
75
+ </Context >
76
+ ```
77
+ this file is essential for the operation of the CDI in TomCat as described here:[ Weld-Doc] ( http://docs.jboss.org/weld/reference/latest/en-US/html_single/#_tomcat )
78
+
79
+ to finish create within /webapp/WEB-INF/ the web.xml file with the following content:
80
+
81
+ ``` xml
82
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
83
+ <web-app xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
84
+ xmlns=" http://java.sun.com/xml/ns/javaee"
85
+ xsi:schemaLocation=" http://java.sun.com/xml/ns/javaee
86
+ http://java.sun.com/xml/ns/javaee/web-app_3_1.xsd"
87
+ version=" 3.1" >
88
+
89
+ <listener >
90
+ <listener-class >org.jboss.weld.environment.servlet.Listener</listener-class >
91
+ </listener >
92
+
93
+ <resource-env-ref >
94
+ <resource-env-ref-name >BeanManager</resource-env-ref-name >
95
+ <resource-env-ref-type >javax.enterprise.inject.spi.BeanManager</resource-env-ref-type >
96
+ </resource-env-ref >
97
+
98
+ <context-param >
99
+ <!-- http://docs.jboss.org/resteasy/docs/3.1.4.Final/userguide/html_single/index.html#d4e143 -->
100
+ <param-name >resteasy.injector.factory</param-name >
101
+ <param-value >org.jboss.resteasy.cdi.CdiInjectorFactory</param-value >
102
+ </context-param >
103
+ </web-app >
104
+ ```
0 commit comments