You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
<?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" >
<!-- 1. 编码过滤器: 解决POST请求和页面乱码 -->
<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>
<!-- 2. SpringMVC核心控制器: 直接从WEB - INF加载springmvc.xml -->
<servlet >
<servlet-name > springmvc</servlet-name>
<servlet-class > org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param >
<param-name > contextConfigLocation</param-name>
<param-value > /WEB-INF/springmvc.xml</param-value>
</init-param>
<load-on-startup > 1</load-on-startup>
</servlet>
<servlet-mapping >
<servlet-name > springmvc</servlet-name>
<url-pattern > /</url-pattern>
</servlet-mapping>
<!-- 3. 欢迎页(可选,不会报错) -->
<welcome-file-list >
<welcome-file > addUser.jsp</welcome-file>
</welcome-file-list>
</web-app>