SpringMVC执行原理
执行原理 1、使用配置的方式编写程序 之前我们使用注解的方式,现在使用配置的方式! 1、创建maven项目 2、导入依赖 3、编写web.xml 注册DispatcherServlet(和之前一样) 4、编写配置文件 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd> 5、添加处理映射器 <bean id="beanNameUrlHandlerMapping" class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/> 6、添加处理适配器 <bean id="simpleControllerHandlerAdapter" class="org.springframework.web