-
<?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">
-
-
<!-- 配置SpringMVC前端控制器 -->
-
<servlet>
-
<servlet-name>mySpringMVC
</servlet-name>
-
<servlet-class>org.springframework.web.servlet.DispatcherServlet
</servlet-class>
-
<!-- 指定SpringMVC配置文件 -->
-
<!-- SpringMVC的配置文件的默认路径是/WEB-INF/${servlet-name}-servlet.xml -->
-
<init-param>
-
<param-name>contextConfigLocation
</param-name>
-
<param-value>classpath:springmvc.xml
</param-value>
-
</init-param>
-
-
<!--监听当服务器启动时 就加载springmvc的配置文件-->
-
<load-on-startup>1
</load-on-startup>
-
-
</servlet>
-
-
-
<servlet-mapping>
-
<servlet-name>mySpringMVC
</servlet-name>
-
<!-- 设置所有以action结尾的请求进入SpringMVC -->
-
<!--拦截所有,但不拦截jsp,包含js,png,css 推荐使用-->
-
<url-pattern>/
</url-pattern>
-
</servlet-mapping>
-
</web-app>