spring <context:annotation-config/> 注解作用

<context:component-scan>包含<context:annotation-config/>的作用

<context:annotation-config/>的作用是对spring容器里已注册的bean进行装配、依赖注入。如:一个A类,有两个属性B、C。这三个bean实例化到spring容器里之后,依赖注入由<context:annotation-config/>来完成。

猜你喜欢

转载自www.cnblogs.com/BaiLaowu/p/9461191.html