1 <?xml version="1.0" encoding="UTF-8"?> 2 <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
5 http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> 6 7 8 <!-- spring监听器,监听springMvc环境 --> 9 <listener>10 <listener-class>org.springframework.web.context.ContextLoaderListener
</listener-class>11 </listener>12 <!-- 加载spring的配置文件 -->13 <context-param>14 <param-name>contextConfigLocation
</param-name>15 <param-value>/WEB-INF/springmvc-servlet.xml
</param-value>16 </context-param>17 <!-- 配置Spring MVC DispatcherServlet -->18 <servlet>19 <servlet-name>springmvc
</servlet-name>20 <servlet-class>org.springframework.web.servlet.DispatcherServlet
</servlet-class>21 <load-on-startup>2
</load-on-startup>22 </servlet>23 <servlet-mapping>24 <servlet-name>springmvc
</servlet-name>25 <url-pattern>*.do
</url-pattern>26 </servlet-mapping>27 </web-app>
3