摘要: 通常情况下我们在创建spring项目的时候在xml配置文件中都会配置这个标签,配置完这个标签后,spring就会去自动扫描base-package对应的路径或者该路径的子包下面的java文件,如果扫描到文件中带有@Service,@Component,@Repository,@Controller等 阅读全文
posted @ 2018-08-15 10:46 沫小淘 阅读(681) 评论(0) 推荐(0) 编辑
摘要: <context:annotation-config> 和 <context:component-scan>的区别 <context:annotation-config> 是用于激活那些已经在spring容器里注册过的bean(无论是通过xml的方式还是通过package sanning的方式)上面 阅读全文
posted @ 2018-08-15 10:33 沫小淘 阅读(156) 评论(0) 推荐(0) 编辑