|
|
<?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">
|
|
|
|
|
|
<display-name>Archetype Created Web Application</display-name>
|
|
|
<!-- <welcome-file-list>-->
|
|
|
<!-- <welcome-file>index.html</welcome-file>-->
|
|
|
<!-- <welcome-file>index.jsp</welcome-file>-->
|
|
|
<!-- <welcome-file>index.htm</welcome-file>-->
|
|
|
<!-- </welcome-file-list>-->
|
|
|
<!--加载是有顺序的-->
|
|
|
<context-param>
|
|
|
|
|
|
<param-name>contextConfigLocation</param-name>
|
|
|
<param-value>classpath:applicationContext.xml</param-value>
|
|
|
</context-param>
|
|
|
|
|
|
<!--过滤器-->
|
|
|
<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>
|
|
|
</filter>
|
|
|
<filter-mapping>
|
|
|
<filter-name>encodingFilter</filter-name>
|
|
|
<!--表示过滤所有的请求-->
|
|
|
<url-pattern>/*</url-pattern>
|
|
|
</filter-mapping>
|
|
|
|
|
|
<!--监听器-->
|
|
|
<listener>
|
|
|
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
|
|
</listener>
|
|
|
|
|
|
<!--下面的代码表示将springmvc-servlet.xml标记为DispatcherServlet(中央处理器/前端控制器)-->
|
|
|
<servlet>
|
|
|
<servlet-name>springmvc</servlet-name>
|
|
|
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
|
|
<init-param>
|
|
|
<param-name>contextConfigLocation</param-name>
|
|
|
<param-value>classpath:springmvc-servlet.xml</param-value>
|
|
|
</init-param>
|
|
|
</servlet>
|
|
|
<servlet-mapping>
|
|
|
<servlet-name>springmvc</servlet-name>
|
|
|
<!--表示映射所有路径-->
|
|
|
<url-pattern>/</url-pattern>
|
|
|
</servlet-mapping>
|
|
|
|
|
|
<!--项目启动会进入这个界面,替代index.jsp-->
|
|
|
<welcome-file-list>
|
|
|
<welcome-file>/WEB-INF/jsp/user/index.jsp</welcome-file>
|
|
|
</welcome-file-list>
|
|
|
|
|
|
</web-app> |