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" >
<servlet >
<servlet-name > DispatcherServlet</servlet-name>
<servlet-class > org.springframework.web.servlet.DispatcherServlet</servlet-class>
<!-- 配置DispatcherServlet前端控制器的初始化参数 -->
<init-param >
<!-- 配置SpringMVC配置文件的路径 -->
<param-name > contextConfigLocation</param-name>
<param-value > classpath:springmvc.xml</param-value>
</init-param>
<!-- 配置DispatcherServlet的创建时刻, 是在Web工程启动时创建, 而不是在调用时创建 -->
<load-on-startup > 1</load-on-startup>
</servlet>
<servlet-mapping >
<servlet-name > DispatcherServlet</servlet-name>
<!-- /代表所有请求 -->
<url-pattern > /</url-pattern>
</servlet-mapping>
<!-- 字符编码过滤器 -->
<filter >
<filter-name > characterEncodingFilter</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 > characterEncodingFilter</filter-name>
<url-pattern > /*</url-pattern>
</filter-mapping>
</web-app>