Spring的<context:annotation-config>和<annotation-driven>

<context:annotation-config>  相对于注册

AutowiredAnnotationBeanPostProcessor、CommonAnnotationBeanPostProcessor、

PersistenceAnnotationBeanPostProcessor 以及 RequiredAnnotationBeanPostProcessor 这 4 个BeanPostProcessor。

支持的注解为: @Required, @Autowired, @PostConstruct 等, 使用了<context:component-scan/> 后就可以将该配置移除。
<mvc:annotation-driven/>相当于注册了DefaultAnnotationHandlerMapping和AnnotationMethodHandlerAdapter两个bean,配置一些messageconverter。即解决了@Controller注解的使用前提配置。

posted on 2016-12-06 16:51  samirL  阅读(171)  评论(0编辑  收藏  举报

导航