<?xml version="1.0" encoding="UTF-8"?>
|
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
|
http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
|
version="4.0"
|
metadata-complete="true">
|
<filter>
|
<filter-name>CharacterEncoding</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>
|
</filter>
|
<filter-mapping>
|
<filter-name>CharacterEncoding</filter-name>
|
<url-pattern>/*</url-pattern>
|
</filter-mapping>
|
|
<!--在web项目中注册SpringMVC的控制器:把所有的请求都交给spring的控制器处理-->
|
<!--Single Page Application-->
|
<servlet>
|
<servlet-name>springDispatcherServlet</servlet-name>
|
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
<multipart-config/>
|
<init-param>
|
<param-name>contextConfigLocation</param-name>
|
<param-value>classpath:spring-servlet.xml</param-value>
|
</init-param>
|
<load-on-startup>1</load-on-startup>
|
</servlet>
|
|
<servlet-mapping>
|
<servlet-name>springDispatcherServlet</servlet-name>
|
<url-pattern>/</url-pattern>
|
</servlet-mapping>
|
<!--针对 post 乱码-->
|
|
<welcome-file-list>
|
<welcome-file>/page/Login.jsp</welcome-file>
|
</welcome-file-list>
|
<error-page>
|
<error-code>404</error-code>
|
<location>/page/error.jsp</location>
|
</error-page>
|
<error-page>
|
<error-code>500</error-code>
|
<location>/page/error.jsp</location>
|
</error-page>
|
<error-page>
|
<error-code>405</error-code>
|
<location>/page/error.jsp</location>
|
</error-page>
|
</web-app>
|