<context:annotation-config> 是用于激活那些已经在spring容器里注册过的bean(无论是通过xml的方式还是通过package sanning的方式)上面的注解。
<context:component-scan>除了具有<context:annotation-config>的功能之外,<context:component-scan>还可以在指定的package下扫描以及注册javabean 。
参考自http://www.cnblogs.com/leiOOlei/p/3713989.html
<mvc:annotation-driven/>相当于注册了DefaultAnnotationHandlerMapping和AnnotationMethodHandlerAdapter两个bean,配置一些messageconverter。即解决了@Controller注解的使用前提配置
如果web.xml配置的是拦截所有请求,并用这个方式解决静态资源访问的问题<mvc:resources mapping="/styles/**" location="/WEB-INF/resource/styles/"/>
那么<mvc:annotation-driven/>就应该配置上。