认识Spring MV
工作流程图解析
前端控制器
前端控制器是Spring MVC的核心,负责接受Http请求并协调各个组件请求工作。
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"<http://java.sun.com/dtd/web-app_2_3.dtd>" >
<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" metadata-complete="true">
<display-name>Archetype Created Web Application</display-name>
<!-- 声明SpringMVC 核心配置对象:DispatcherServlet,作用是接受所有用户的请求-->
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<!-- 启动SpringMVC IoC容器(springmvc.xml)-->
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:springmvc.xml</param-value>
</init-param>
<!-- 表示web容器启动时,启动DIspatcherServlet(值越小最先启动)-->
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
servlet-mappering负责将在<url-pattern>标签标明的url地址转给同 <servlet-name>的servlet处理
标签:控制器,认识,Spring,springmvc,MVC,xsi,servlet From: https://www.cnblogs.com/chenchenlol/p/17744296.html