您的位置:首页 > 其它

<context:component-scan/> 作用

2016-02-04 14:32 141 查看
在Spring 的配置文件中一般会有:

<context:component-scan base-package="com.test.*.*.controller" />

其作用是扫描这个base-package的路径

向spring容器中注入了AutowiredAnnotationBeanPostProcessor CommonAnnotationBeanPostProcessor

PersistenceAnnotationBeanPostProcessor
RequiredAnnotationBeanPostProcessor这四个bean

让系统可以知道相应的注解 如 @Resource等等
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: