1 <?xml version="1.0" encoding="UTF-8"?> 2 <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> 3 <display-name>SSM2</display-name> 4 <welcome-file-list> 5 <welcome-file>index.html</welcome-file> 6 <welcome-file>index.htm</welcome-file> 7 <welcome-file>index.jsp</welcome-file> 8 <welcome-file>default.html</welcome-file> 9 <welcome-file>default.htm</welcome-file> 10 <welcome-file>default.jsp</welcome-file> 11 </welcome-file-list> 12 <!-- 监听器 --> 13 <listener> 14 <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> 15 </listener> 16 <context-param> 17 <param-name>contextConfigLocation</param-name> 18 <param-value>classpath:applicationContext.xml</param-value> 19 </context-param> 20 <!-- SpringMvc前端控制器 --> 21 <servlet> 22 <servlet-name>springmvc</servlet-name> 23 <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 24 <init-param> 25 <param-name>contextConfigLocation</param-name> 26 <param-value>classpath:springmvc.xml</param-value> 27 </init-param> 28 </servlet> 29 <servlet-mapping> 30 <servlet-name>springmvc</servlet-name> 31 <url-pattern>/</url-pattern> 32 </servlet-mapping> 33 <!-- filter过滤器 --> 34 <filter> 35 <filter-name>encod</filter-name> 36 <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> 37 <init-param> 38 <param-name>encoding</param-name> 39 <param-value>UTF-8</param-value> 40 </init-param> 41 </filter> 42 <filter-mapping> 43 <filter-name>encod</filter-name> 44 <url-pattern>/*</url-pattern> 45 </filter-mapping> 46 </web-app>