web.xml 7.2 KB
Newer Older
Matija Obreza's avatar
Matija Obreza committed
1
<?xml version="1.0" encoding="UTF-8"?>
Matija Obreza's avatar
Matija Obreza committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!--
  Copyright 2014 Global Crop Diversity Trust
  
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
  
    http://www.apache.org/licenses/LICENSE-2.0
  
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

18
19
20
21
22
<web-app 
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    version="3.0">
Matija Obreza's avatar
Matija Obreza committed
23

igoshin's avatar
igoshin committed
24
25
26
27
28
29
30
31
32
33
34
    <!--<context-param>-->
        <!--<param-name>contextConfigLocation</param-name>-->
        <!--<param-value>classpath:spring/application-context.xml</param-value>-->
    <!--</context-param>-->

    <context-param>
        <param-name>contextClass</param-name>
        <param-value>
            org.springframework.web.context.support.AnnotationConfigWebApplicationContext
        </param-value>
    </context-param>
Matija Obreza's avatar
Matija Obreza committed
35
36
    <context-param>
        <param-name>contextConfigLocation</param-name>
igoshin's avatar
igoshin committed
37
        <param-value>org.genesys2.spring.config.ApplicationConfig</param-value>
Matija Obreza's avatar
Matija Obreza committed
38
    </context-param>
igoshin's avatar
igoshin committed
39

40
41
42
	<listener>
	    <listener-class>com.hazelcast.web.SessionListener</listener-class>
	</listener>
Matija Obreza's avatar
Matija Obreza committed
43
44
45
46
47
48
49
50

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <listener>
        <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    </listener>

Matija Obreza's avatar
Matija Obreza committed
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
	<filter>
		<filter-name>encodingFilter</filter-name>
		<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
		<init-param>
			<param-name>encoding</param-name>
			<param-value>UTF-8</param-value>
		</init-param>
		<init-param>
			<param-name>forceEncoding</param-name>
			<param-value>true</param-value>
		</init-param>
	</filter>
	<filter-mapping>
		<filter-name>encodingFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
Matija Obreza's avatar
Matija Obreza committed
67
	
Matija Obreza's avatar
Matija Obreza committed
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
	
	<!-- Cross origin for web REST API clients -->
	<filter>
        <filter-name>cross-origin</filter-name>
        <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
        <!-- <init-param>
	        <param-name>allowedOrigins</param-name>
	        <param-value>*</param-value>
	    </init-param> -->
<!--         <init-param>
        	<param-name>allowCredentials</param-name>
        	<param-value>true</param-value>
        </init-param>
 -->
        <init-param>
        	<param-name>allowedMethods</param-name>
        	<param-value>GET,POST,PUT,DELETE</param-value>
        </init-param>
 		<init-param>
	        <param-name>allowedHeaders</param-name>
Matija Obreza's avatar
Matija Obreza committed
88
	        <param-value>authorization,content-type</param-value>
Matija Obreza's avatar
Matija Obreza committed
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
	    </init-param>
	    <!-- Do not chain preflight request to application -->
        <init-param>
	        <param-name>chainPreflight</param-name>
	        <param-value>false</param-value>
	    </init-param>
    </filter>
	<filter-mapping>
	    <filter-name>cross-origin</filter-name>
	    <url-pattern>/oauth/token</url-pattern>
	</filter-mapping>
	<filter-mapping>
	    <filter-name>cross-origin</filter-name>
	    <url-pattern>/api/*</url-pattern>
	</filter-mapping>
	
	
	
Matija Obreza's avatar
Matija Obreza committed
107
108
109
110
111
112
113
114
115
116
117
118
	<filter>
        <filter-name>hazelcastWebFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <init-param>
            <param-name>targetFilterLifecycle</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>hazelcastWebFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
Matija Obreza's avatar
Matija Obreza committed
119

Matija Obreza's avatar
Matija Obreza committed
120
121
122
123
124
125
126
127
    <filter>
        <filter-name>org.springframework.security.filterChainProxy</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>org.springframework.security.filterChainProxy</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
128
129
    
	<filter>
Matija Obreza's avatar
Matija Obreza committed
130
		<description>Adds variables to all requests</description>
131
132
133
134
135
136
137
        <filter-name>envVarFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>envVarFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
igoshin's avatar
igoshin committed
138
139
140
141
142
143
144
145
146
147

    <filter>
        <description>Filter API</description>
        <filter-name>apiFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>apiFilter</filter-name>
        <url-pattern>/api/genesys-api.js</url-pattern>
    </filter-mapping>
Matija Obreza's avatar
Matija Obreza committed
148
149
150
151
152
153
154
155
156
	
	<filter>
		<filter-name>sitemesh</filter-name>
		<filter-class>org.sitemesh.config.ConfigurableSiteMeshFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>sitemesh</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
igoshin's avatar
igoshin committed
157
	
Matija Obreza's avatar
Matija Obreza committed
158
159
160
161
162
    <servlet>
        <servlet-name>mvc</servlet-name>
        <servlet-class>
            org.springframework.web.servlet.DispatcherServlet
        </servlet-class>
igoshin's avatar
igoshin committed
163
164
165
166
167
168
        <init-param>
            <param-name>contextClass</param-name>
            <param-value>
                org.springframework.web.context.support.AnnotationConfigWebApplicationContext
            </param-value>
        </init-param>
Matija Obreza's avatar
Matija Obreza committed
169
170
        <init-param>
            <param-name>contextConfigLocation</param-name>
igoshin's avatar
igoshin committed
171
172
173
            <param-value>
                org.genesys2.spring.config.SpringServletConfig
            </param-value>
Matija Obreza's avatar
Matija Obreza committed
174
175
176
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
177
178
179
180
181
182
183
184
185
186
187
188
189
190
    
    <servlet>
		<servlet-name>default</servlet-name>
		<init-param>
			<param-name>dirAllowed</param-name>
			<param-value>false</param-value>
		</init-param>
	</servlet>

	<!-- Use default Jetty servlet for static resources in /html/* -->
	<servlet-mapping>
		<servlet-name>default</servlet-name>
		<url-pattern>/html/*</url-pattern>
	</servlet-mapping>
Matija Obreza's avatar
Matija Obreza committed
191
192
193
194
195
196
197
198
199
200

    <servlet-mapping>
        <servlet-name>mvc</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
        <welcome-file>/index.html</welcome-file>
    </welcome-file-list>

201
202
203
204
205
206
207
208
	<error-page>
		<error-code>401</error-code>  
		<location>/WEB-INF/jsp/errors/401.jsp</location>  
	</error-page>
    <error-page>
		<error-code>404</error-code>  
		<location>/WEB-INF/jsp/errors/404.jsp</location>  
	</error-page>
Matija Obreza's avatar
Matija Obreza committed
209
    <error-page>
Matija Obreza's avatar
Layouts    
Matija Obreza committed
210
		<error-code>500</error-code>  
211
212
213
214
215
216
		<location>/WEB-INF/jsp/errors/500.jsp</location>  
	</error-page>
    <error-page>
		<error-code>503</error-code>  
		<location>/WEB-INF/jsp/errors/503.jsp</location>  
	</error-page>
Matija Obreza's avatar
Updates    
Matija Obreza committed
217
    <session-config>
Matija Obreza's avatar
Matija Obreza committed
218
        <session-timeout>30</session-timeout>
219
        <tracking-mode>COOKIE</tracking-mode>
Matija Obreza's avatar
Matija Obreza committed
220
221
    </session-config>

Matija Obreza's avatar
Matija Obreza committed
222
223
224
225
226
227
	<jsp-config>
	    <jsp-property-group>
	        <url-pattern>*.jsp</url-pattern>
	        <page-encoding>UTF-8</page-encoding>
	    </jsp-property-group>
	</jsp-config>
228
</web-app>