1.配置流程
1.1 配置前端控制器,对浏览器请求统一处理
1.2 配置 springMVC的配置文件路径
1.3 启动改为服务器启动时
<?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"> <!-- 配置前端控制器,对浏览器请求统一处理--> <servlet> <servlet-name>springMVC</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <!-- 配置 springMVC的配置文件路径--> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:springMVC.xml</param-value> </init-param> <!-- 启动改为服务器启动时--> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>springMVC</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> </web-app>
标签:springMVC01,1.1,配置文件,启动,springMVC,配置 From: https://www.cnblogs.com/cciscc/p/16613559.html