注解映射器与适配器

xiaoxiao2021-02-28  51

1.当我们不在springmvc.xml文件中配置映射器处理器以及映射器适配器

springmvc会根据默认值来加载默认的映射器处理器以及映射器适配器

如下图回家再properties文件中默认配置的数据

2.对于处理器以及适配器

在3.1版本之前使用

"org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"

"org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"

"org.springframework.web.servlet.mvc.annotation.DefaultMethodHandleAdapter"

"org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"

可以使用<mvc:annotation-driver/>mvc 注解驱动   添加了好多MVC参数绑定方法比如json转换器

用注解的映射器与适配器 与非注解的ying舍弃与适配器不能同时用在一个handler

转载请注明原文地址: https://www.6miu.com/read-94859.html

最新回复(0)