点进去看源码:

过时了。那我们找新的。
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo" xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd">
<!-- 配置@Controller注解扫描 -->
<context:component-scan base-package="com.ken.controller" />
<!-- 如果没有显示的配置处理器映射器和处理器适配器, 那么springmvc就会去默认的dispatchServlet.properties中查找,
对应的处理器映射器和处理器适配器去使用, 这样每个请求都要扫描一次它的默认配置文件, 效率非常低,会降低访问速度 -->
<!-- 配置最新版的注解的处理器映射器 -->
<bean
class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"></bean>
<!-- 配置最新版的注解的处理器适配器 -->
<bean
class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"></bean>
</beans>
那每次spring出了新的处理器映射器和处理器适配器,那么,我们都要去改啊。这样不行。配置注解驱动。
本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/jisuanjixue/article-73123-2.html
包括军舰
还讲陆军