@SpringBootApplication注解的作用:
在这个注解里面,最重要的是三个注解"
@SpringbootConfiguration;@EnableAutoConfiguration;@ComponentScan
1.@SpringbootConfiguration 是SpringBoot特有的相当于封装的@Configuration注解,表示这个是配置类
2.@EnableAutoConfiguration 这个注解里有两个注解@AutoConfigurationPackage (把所有包都扫描一篇)和 @import(导入指定路径的类)
3.@ComponentScan 扫描所有定义路径的类放入Spring容器中
感谢笔记,让自己学而知不足。