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注解的使用前提配置。

原文地址:https://www.cnblogs.com/markleilei/p/6138182.html