@ComponentScan
@ComponentScan将@Controller @Service @Repository,@Component标识的类注入到spring容器
这些相当于是
<bean id="" class="">
@ComponentScan
相当于是xml文件
在Springboot中有个@SpringBootApplication注解里面有@ComponetScan扫描的是@SpringBootApplication类路径同级或者包下的注解
标签:Service,spring,SpringBootApplication,ComponentScan,注解,相当于 From: https://www.cnblogs.com/tsqo/p/16968209.html