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" >
<!-- spring核心容器配置: -->
<!-- 先向ServletContext中添加spring核心配置文件的位置 -->
<context-param >
<param-name > contextConfigLocation</param-name>
<param-value > classpath:applicationContext.xml</param-value>
</context-param>
<!-- 任何地方需要对象的时候都应该从application中获取 请求域 会话域 应用域 -->
<!--
通过监听器,监听JAVAWEB中的ServletContext对象( 应用域) ,
就创建一个spring容器, 并且放入ServletContext中
-->
<listener >
<listener-class > org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- DispatcherServlet 前端控制器 -->
<servlet >
<servlet-name > dispatcherServlet</servlet-name>
<servlet-class > org.springframework.web.servlet.DispatcherServlet</servlet-class>
<!-- 指定配置文件的位置 -->
<init-param >
<param-name > contextConfigLocation</param-name>
<param-value > classpath:springmvc.xml</param-value>
</init-param>
</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>
</filter>
<filter-mapping >
<filter-name > characterEncodingFilter</filter-name>
<url-pattern > /*</url-pattern>
</filter-mapping>
</web-app>