|
@@ -3,45 +3,25 @@
|
3
|
3
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
4
|
4
|
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
|
5
|
5
|
version="4.0">
|
6
|
|
-
|
7
|
|
- <!--解决乱码的过滤器-->
|
8
|
|
- <filter>
|
9
|
|
- <filter-name>CharacterEncodingFilter</filter-name>
|
10
|
|
- <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
|
11
|
|
- <init-param>
|
12
|
|
- <param-name>encoding</param-name>
|
13
|
|
- <param-value>UTF-8</param-value>
|
14
|
|
- </init-param>
|
15
|
|
- </filter>
|
16
|
|
- <filter-mapping>
|
17
|
|
- <filter-name>CharacterEncodingFilter</filter-name>
|
18
|
|
- <url-pattern>/*</url-pattern>
|
19
|
|
- </filter-mapping>
|
20
|
|
-
|
21
|
|
- <!--全局的初始化参数-->
|
22
|
|
- <context-param>
|
23
|
|
- <param-name>contextConfigLocation</param-name>
|
24
|
|
- <param-value>classpath:applicationContext.xml</param-value>
|
25
|
|
- </context-param>
|
26
|
|
- <!--Spring的监听器-->
|
27
|
|
- <listener>
|
28
|
|
- <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
29
|
|
- </listener>
|
30
|
|
-
|
31
|
|
-
|
32
|
|
- <!--SpringMVC的前端控制器-->
|
33
|
|
- <servlet>
|
34
|
|
- <servlet-name>DispatcherServlet</servlet-name>
|
35
|
|
- <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
36
|
|
- <init-param>
|
37
|
|
- <param-name>contextConfigLocation</param-name>
|
38
|
|
- <param-value>classpath:spring-mvc.xml</param-value>
|
39
|
|
- </init-param>
|
40
|
|
- <load-on-startup>2</load-on-startup>
|
41
|
|
- </servlet>
|
42
|
|
- <servlet-mapping>
|
43
|
|
- <servlet-name>DispatcherServlet</servlet-name>
|
44
|
|
- <url-pattern>/</url-pattern>
|
45
|
|
- </servlet-mapping>
|
|
6
|
+ <context-param>
|
|
7
|
+ <param-name>contextConfigLocation</param-name>
|
|
8
|
+ <param-value>classpath:applicationContext.xml</param-value>
|
|
9
|
+ </context-param>
|
|
10
|
+ <listener>
|
|
11
|
+ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
|
12
|
+ </listener>
|
|
13
|
+ <servlet>
|
|
14
|
+ <servlet-name>dispatcherServlet</servlet-name>
|
|
15
|
+ <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
|
16
|
+ <init-param>
|
|
17
|
+ <param-name>contextConfigLocation</param-name>
|
|
18
|
+ <param-value>classpath:spring-mvc.xml</param-value>
|
|
19
|
+ </init-param>
|
|
20
|
+ <load-on-startup>1</load-on-startup>
|
|
21
|
+ </servlet>
|
|
22
|
+ <servlet-mapping>
|
|
23
|
+ <servlet-name>dispatcherServlet</servlet-name>
|
|
24
|
+ <url-pattern>/</url-pattern>
|
|
25
|
+ </servlet-mapping>
|
46
|
26
|
|
47
|
27
|
</web-app>
|