1
<?xml version="1.0" encoding="UTF-8"?>
2
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
3
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
5
6
	<context-param>
7
    	<param-name>contextClass</param-name>
8
    	<param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
9
	</context-param>
10
11
	<context-param>
12
    	<param-name>contextConfigLocation</param-name>
13
    	<param-value>com.springsource.greenhouse.config</param-value>
14
	</context-param>
15
	
16
	<context-param>
17
    	<param-name>contextInitializerClasses</param-name>
18
    	<param-value>com.springsource.greenhouse.config.ContextInitializer</param-value>
19
	</context-param>
20
	
21
	<!-- Creates the Spring Container shared by all Servlets and Filters -->
22
	<listener>
23
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
24
	</listener>
25
26
	<!-- Allows attributes to be accessed on the next request -->
27
	<filter>
28
		<filter-name>flashMapFilter</filter-name>
29
		<filter-class>org.springframework.web.flash.FlashMapFilter</filter-class>
30
	</filter>
31
32
	<filter-mapping>
33
		<filter-name>flashMapFilter</filter-name>
34
		<url-pattern>/*</url-pattern>
35
	</filter-mapping>
36
37
	<!-- Enables support for DELETE and PUT request methods with web browser clients -->
38
	<filter>
39
		<filter-name>hiddenHttpMethodFilter</filter-name>
40
		<filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
41
	</filter>
42
43
	<filter-mapping>
44
		<filter-name>hiddenHttpMethodFilter</filter-name>
45
		<url-pattern>/*</url-pattern>
46
	</filter-mapping>
47
48
	<!-- Secures the application -->
49
	<filter>
50
		<filter-name>securityFilter</filter-name>
51
		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
52
		<init-param>
53
			<param-name>targetBeanName</param-name>
54
			<param-value>springSecurityFilterChain</param-value>
55
		</init-param>
56
	</filter>
57
58
	<filter-mapping>
59
		<filter-name>securityFilter</filter-name>
60
		<url-pattern>/*</url-pattern>
61
	</filter-mapping>
62
63
	<!-- H2 Database Console for managing the app's database -->
64
	<servlet>
65
		<servlet-name>H2Console</servlet-name>
66
		<servlet-class>org.h2.server.web.WebServlet</servlet-class>
67
		<init-param>
68
			<param-name>-webAllowOthers</param-name>
69
			<param-value>true</param-value>
70
		</init-param>
71
		<load-on-startup>2</load-on-startup>
72
	</servlet>
73
74
	<servlet-mapping>
75
		<servlet-name>H2Console</servlet-name>
76
		<url-pattern>/admin/h2/*</url-pattern>
77
	</servlet-mapping>
78
79
	<!-- Handles requests into the application -->
80
	<servlet>
81
		<servlet-name>appServlet</servlet-name>
82
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
83
		<init-param>
84
			<param-name>contextConfigLocation</param-name>
85
			<param-value></param-value>
86
		</init-param>
87
		<load-on-startup>1</load-on-startup>
88
	</servlet>
89
90
	<servlet-mapping>
91
		<servlet-name>appServlet</servlet-name>
92
		<url-pattern>/</url-pattern>
93
	</servlet-mapping>
94
95
</web-app>