@SpringBootApplication 使用

解释:之前用户使用的是3个注解注解他们的main类。分别是@Configuration,@EnableAutoConfiguration,@ComponentScan。由于这些注解一般都是一起使用,spring boot提供了一个统一的注解@SpringBootApplication。

 

作用:@SpringBootApplication = (默认属性)@Configuration + @EnableAutoConfiguration + @ComponentScan。

 

参考博客:https://www.cnblogs.com/MaxElephant/p/8108140.html

posted @ 2020-05-24 18:56  怪兽不纯粹  阅读(245)  评论(0)    收藏  举报