SpringBoot默认包扫描机制及使用@ComponentScan指定扫描路径

SpringBoot默认包扫描机制 标注了@Component和@Component的衍生注解如@Controller,@Service,@Repository就能够把当前的Bean加入到IOC容器中。那么SpringBoot是如何知道要去扫描@Component注解的呢。@ComponentScan作的事情就是告诉Spring从哪里找到beanjava SpringBoot默认包扫描机制: 从启
相关文章
相关标签/搜索