使用idea创建springboot
点击file选择new project
在红色框写一个springbootdemo
点击next再点击完成
创建一个HelloController
程序自动生成的SpringbootdemoApplication,会有一个@SpringBootApplication的注解,这个注解用来标明这个类是程序的入口
@SpringBootApplication开启了Spring的组件扫描和springboot的自动配置功能,相当于将以下三个注解组合在了一起
(1)@Configuration:表名该类使用基于Java的配置,将此类作为配置类
(2)@ComponentScan:启用注解扫描
(3)@EnableAutoConfiguration:开启springboot的自动配置功能
运行SpringbootdemoApplication类
测试