web.xml 9.56 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
    <!--<context-param>-->
        <!--<param-name>contextConfigLocation</param-name>-->
        <!--<param-value>classpath:spring/application-context.xml</param-value>-->
    <!--</context-param>-->

Matija Obreza's avatar
Matija Obreza committed
29
30
31
32
33
34
35
36
37
38
39
40
	<context-param>
		<param-name>contextClass</param-name>
		<param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
	</context-param>
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>org.genesys2.spring.config.ApplicationConfig</param-value>
	</context-param>
	<context-param>
		<param-name>defaultHtmlEscape</param-name>
		<param-value>true</param-value>
	</context-param>
igoshin's avatar
igoshin committed
41

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

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
49
   
Matija Obreza's avatar
Matija Obreza committed
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
	<filter>
		<filter-name>UrlRewriteFilter</filter-name>
		<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
		<init-param>
			<param-name>confReloadCheckInterval</param-name>
			<param-value>10</param-value>
		</init-param>
		<!-- <init-param>
			<param-name>logLevel</param-name>
			<param-value>sysout:DEBUG</param-value>
		</init-param> -->
	</filter>
	<filter-mapping>
	    <filter-name>UrlRewriteFilter</filter-name>
	    <url-pattern>/*</url-pattern>
	    <dispatcher>REQUEST</dispatcher>
	    <dispatcher>FORWARD</dispatcher>
	</filter-mapping>
Matija Obreza's avatar
Matija Obreza committed
68

Matija Obreza's avatar
Matija Obreza committed
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
	<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
85
	
Matija Obreza's avatar
Matija Obreza committed
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
	<!-- 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>
105
	        <param-value>*</param-value>
Matija Obreza's avatar
Matija Obreza committed
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
	    </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>
121
122
123
124
	<filter-mapping>
	    <filter-name>cross-origin</filter-name>
	    <url-pattern>/webapi/*</url-pattern>
	</filter-mapping>
Matija Obreza's avatar
Matija Obreza committed
125
126
127
	
	
	
Matija Obreza's avatar
Matija Obreza committed
128
129
130
131
132
133
134
135
136
137
138
	<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>
139
140
141
        <dispatcher>FORWARD</dispatcher>
	    <dispatcher>INCLUDE</dispatcher>
    	<dispatcher>REQUEST</dispatcher>
Matija Obreza's avatar
Matija Obreza committed
142
    </filter-mapping>
Matija Obreza's avatar
Matija Obreza committed
143

Matija Obreza's avatar
Matija Obreza committed
144
145
146
147
148
149
150
151
    <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>
152
    
153
154
155
156
157
158
    
	<filter>
		<filter-name>localeURLFilter</filter-name>
		<filter-class>org.genesys2.server.servlet.filter.LocaleURLFilter</filter-class>
		<init-param>
			<param-name>exclude-paths</param-name>
159
			<param-value>/html /login-attempt</param-value>
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
		</init-param>
		<init-param>
			<param-name>default-locale</param-name>
			<param-value>en</param-value>
		</init-param>
		<init-param>
			<param-name>allowed-locales</param-name>
			<param-value>en es de fr fa ar ru zh pt</param-value>
		</init-param>
	</filter>
	<filter-mapping>
		<filter-name>localeURLFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	
    
176
	<filter>
Matija Obreza's avatar
Matija Obreza committed
177
		<description>Adds variables to all requests</description>
178
179
180
181
182
183
184
        <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
185
186

    <filter>
Matija Obreza's avatar
Matija Obreza committed
187
188
        <description>Genesys Web API Filter</description>
        <filter-name>webApiFilter</filter-name>
igoshin's avatar
igoshin committed
189
190
191
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>
    <filter-mapping>
Matija Obreza's avatar
Matija Obreza committed
192
193
        <filter-name>webApiFilter</filter-name>
        <url-pattern>/webapi/*</url-pattern>
igoshin's avatar
igoshin committed
194
    </filter-mapping>
Matija Obreza's avatar
Matija Obreza committed
195
196
197
198
199
	
	<filter>
		<filter-name>sitemesh</filter-name>
		<filter-class>org.sitemesh.config.ConfigurableSiteMeshFilter</filter-class>
	</filter>
200
    <filter-mapping>
Matija Obreza's avatar
Matija Obreza committed
201
202
203
		<filter-name>sitemesh</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
204

Matija Obreza's avatar
Matija Obreza committed
205
206
207
208
209
    <servlet>
        <servlet-name>mvc</servlet-name>
        <servlet-class>
            org.springframework.web.servlet.DispatcherServlet
        </servlet-class>
igoshin's avatar
igoshin committed
210
211
212
213
214
215
        <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
216
217
        <init-param>
            <param-name>contextConfigLocation</param-name>
igoshin's avatar
igoshin committed
218
219
220
            <param-value>
                org.genesys2.spring.config.SpringServletConfig
            </param-value>
Matija Obreza's avatar
Matija Obreza committed
221
222
223
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
224
225
    
    <servlet>
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
			<servlet-name>default</servlet-name>
			<init-param>
				<param-name>dirAllowed</param-name>
				<param-value>false</param-value>
			</init-param>
			<init-param>
	      <param-name>maxCacheSize</param-name>
	      <param-value>256000000</param-value>
	    </init-param>
	    <init-param>
	      <param-name>maxCachedFileSize</param-name>
	      <param-value>200000000</param-value>
	    </init-param>
	    <init-param>
	      <param-name>maxCachedFiles</param-name>
	      <param-value>2048</param-value>
	    </init-param>
	    <init-param>
	      <param-name>gzip</param-name>
	      <param-value>true</param-value>
	    </init-param>
	    <init-param>
	      <param-name>etags</param-name>
	      <param-value>true</param-value>
	    </init-param>
	    <init-param>
	      <param-name>useFileMappedBuffer</param-name>
	      <param-value>true</param-value>
	    </init-param>
<!--
 	    <init-param>
	      <param-name>resourceCache</param-name>
	      <param-value>resourceCache</param-value>
	    </init-param>
 -->
 	    <init-param>
	      <param-name>cacheControl</param-name>
	      <param-value>private, max-age=1200</param-value>
	    </init-param>
		</servlet>
Matija Obreza's avatar
Matija Obreza committed
266

267
268
269
270
271
272
273
274
275
276
277
278
279
280
		<!-- Use default Jetty servlet for static resources in /html/* -->
		<servlet-mapping>
			<servlet-name>default</servlet-name>
			<url-pattern>/html/*</url-pattern>
		</servlet-mapping>
	
		<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>
Matija Obreza's avatar
Matija Obreza committed
281

282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
		<error-page>
			<error-code>401</error-code>  
			<location>/errors/401</location>  
		</error-page>
	  <error-page>
			<error-code>404</error-code>  
			<location>/errors/404</location>  
		</error-page>
	  <error-page>
			<error-code>500</error-code>  
			<location>/errors/500</location>  
		</error-page>
	  <error-page>
			<error-code>503</error-code>  
			<location>/errors/503</location>  
		</error-page>
		<session-config>
			<session-timeout>30</session-timeout>
			<tracking-mode>COOKIE</tracking-mode>
		</session-config>
Matija Obreza's avatar
Matija Obreza committed
302

Matija Obreza's avatar
Matija Obreza committed
303
304
305
306
307
308
	<jsp-config>
	    <jsp-property-group>
	        <url-pattern>*.jsp</url-pattern>
	        <page-encoding>UTF-8</page-encoding>
	    </jsp-property-group>
	</jsp-config>
Matija Obreza's avatar
Matija Obreza committed
309
310
311
312
313
	<session-config>
		<cookie-config>
			<http-only>true</http-only>
		</cookie-config>
	</session-config>
314
</web-app>