<context:annotation-config/>
这个标签是隐式地向 Spring容器注册AutowiredAnnotationBeanPostProcessor、RequiredAnnotationBeanPostProcessor、CommonAnnotationBeanPostProcessor以及PersistenceAnnotationBeanPostProcessor这4个BeanPostProcessor,
也就是可以在在代码中使用例如@Autowire或者@Resource.
<context:component-scan base-package=""/>
这个标签跟上面的有一样的功能,并且能够扫描包里的注释,注册到容器.
mvc中配置,使用 REST 风格的资源url,如果需要处理静态资源则要同时加入一下两个配置:
<mvc:default-servlet-handler />
<mvc:annotation-driven />