`
perfy315
  • 浏览: 412139 次
社区版块
存档分类
最新评论

<mvc:annotation-driven/>标签说明

阅读更多
annotation-driven缺省注册类的改变

Spring 3.0.x中使用了annotation-driven后,缺省使用DefaultAnnotationHandlerMapping 来注册handler method和request的mapping关系。 AnnotationMethodHandlerAdapter来在实际调用handlermethod前对其参数进行处理。



在spring mvc 3.1中,对应变更为
DefaultAnnotationHandlerMapping -> RequestMappingHandlerMapping
AnnotationMethodHandlerAdapter -> RequestMappingHandlerAdapter
AnnotationMethodHandlerExceptionResolver -> ExceptionHandlerExceptionResolver

以上都在使用了annotation-driven后自动注册。
  而且对应分别提供了AbstractHandlerMethodMapping , AbstractHandlerMethodAdapter和 AbstractHandlerMethodExceptionResolver以便于让用户更方便的实现自定义的实现类。

<mvc:annotation-driven/>相当于注册了DefaultAnnotationHandlerMapping和AnnotationMethodHandlerAdapter两个bean,配置一些messageconverter。即解决了@Controller注解的使用前提配置。

转至:http://blog.csdn.net/marila4720/article/details/9203813
分享到:
评论

相关推荐

    拦截器与冲突解决

    NULL 博文链接:https://xj84.iteye.com/blog/2065681

    SpringMVC源码总结(三)mvc:annotation-driven和mvc:message-converters简单介绍

    NULL 博文链接:https://lgbolgger.iteye.com/blog/2105151

    SpringMVC源码总结(二)mvc:mvc:annotation-driven背后的那些事

    NULL 博文链接:https://yihuawuye1.iteye.com/blog/2105063

    (代码)SpringMVC第12讲:<mvc:annotation-driven/>

    SpringMVC第12讲:&lt;mvc:annotation-driven/&gt;

    Spring MVC入门教程

    个人认为相当适合入门和知识巩固!! 一、前言 二、spring mvc 核心类与接口 ...十九、 &lt;mvc:annotation-driven /&gt; 到底做了什么工作 二十、 本文中springMVC.xml配置文件是核心,这里给一个下载地址

    Spring MVC 教程 快速入门 深入分析

    Spring MVC 教程 快速入门 深入分析 目录 一、前言 二、spring mvc 核心类与接口 三、spring mvc 核心流程图 四、spring mvc DispatcherServlet说明 ...十九、 &lt;mvc:annotation-driven /&gt; 到底做了什么工作

    基于MyEclipse搭建maven+springmvc整合图文教程(含源码0

    &lt;mvc:annotation-driven /&gt; &lt;context:component-scan base-package="Controller" /&gt; &lt;bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt; &lt;property name="prefix" value="/...

    SpringMVC框架架构介绍

    一、前言 二、spring mvc 核心类与接口 三、spring mvc 核心流程图 四、spring mvc ...十九、 &lt;mvc:annotation-driven /&gt; 到底做了什么工作 二十、 本文中springMVC.xml配置文件是核心,这里给一个下载地址

    SpringMVC入门教程

    SpringMVC: 一、前言 二、spring mvc 核心类与接口 三、spring mvc 核心流程图 ...十九、 &lt;mvc:annotation-driven /&gt; 到底做了什么工作 二十、 本文中springMVC.xml配置文件是核心,这里给一个下载地址

    SpringMVC+Hibernate实例

    &lt;mvc:annotation-driven/&gt; &lt;!--视图解析--&gt; &lt;bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt; &lt;property name="viewClass" value="org.springframework....

    SpringMVC+Hibernate全注解整合

    &lt;mvc:annotation-driven/&gt; &lt;!-- 扫描包 --&gt; &lt;context:annotation-config/&gt; &lt;context:component-scan base-package="com.org.*" /&gt; &lt;bean id="jspViewResolver" class="org.springframework.web.servlet.view...

    license.txt

    &lt;mvc:annotation-driven&gt; &lt;/mvc:annotation-driven&gt; 中配置Json格式乱码。代码如下: &lt;!--json格式乱码处理--&gt; &lt;mvc:message-converters register-defaults="true"&gt; &lt;bean class="org.springframework....

    Spring3中配置DBCP,C3P0,Proxool,Bonecp数据源

    &lt;mvc:annotation-driven /&gt; &lt;mvc:resources mapping="/resources/**" location="/resources/" /&gt; &lt;mvc:default-servlet-handler /&gt; &lt;aop:config proxy-target-class="true"/&gt; &lt;tx:annotation-driven ...

    spring_MVC源码

    14. &lt;bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" /&gt; 15. 16. &lt;!-- 对模型视图名称的解析,即在模型视图名称添加前后缀 --&gt; 17. &lt;bean class="org....

    annotation.txt

    &lt;mvc:annotation-driven /&gt; 是一种简写形式,完全可以手动配置替代这种简写形式,简写形式可以让初学都快速应用默认配置方案。配置一些messageconverter。即解决了@Controller注解的使用前提配置&lt;context:annotation...

    jackson-core-asl-1.9.8.jar+jackson-mapper-asl-1.9.8.jar下载

    spring mvc 时用@ResponseBody 传json格式,使用&lt;mvc:annotation-driven /&gt; 会自动注册

    java7源码-spring_test:弹簧测试

    mvc:annotation-driven/ 这个大概的意思就是识别注解 4.4 最后需要配置一个视图解析器 InternalResourceViewResolver 详情查看这个文件夹 还有一个就是applicationContext.xml文件 这个在这个项目没有用到 小小总结...

    springmybatis

    DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"&gt; &lt;configuration&gt; &lt;typeAliases&gt; &lt;typeAlias alias="User" type=...

    iLink:拉丁云代码测试Spring MVC

    spring-mvc.xml 配置自动扫描的包、配置视图解析器 如何把 handler方法返回值解析为实际的物理视图、配置静态资源映射静态资源交给默认的Servlet、配置 mvc:annotation-driven标签开启注解(4)@RestController =@...

Global site tag (gtag.js) - Google Analytics