<context:annotation-config> 和 <context:component-scan>的区别

来源:互联网 发布:excel数据拟合 编辑:程序博客网 时间:2024/06/06 01:23

<context:annotation-config> 

是用于激活那些已经在spring容器里注册过的bean(无论是通过xml的方式还是通过package sanning的方式)上面的注解。


<context:component-scan>

除了具有<context:annotation-config>的功能之外,<context:component-scan>还可以在指定的package下扫描以及注册javabean 。

0 0
原创粉丝点击