• 内置tomcat
  • 提供自动配置
  • 搭建spring应用的脚手架
  • 解决了复杂的配置
  • 混乱的依赖关系

官方文档:​​https://docs.spring.io/spring-boot/docs/2.0.6.RELEASE/reference/htmlsingle/​

springboot项目都需要以下面这个为父工程(所有的springboot应用都要以该工程为父工程)


org.springframework.boot
spring-boot-starter-parent
2.0.6.RELEASE

添加依赖




org.springframework.boot
spring-boot-starter-web


springboot的四种属性注入

1.@Autowired注入

2.构造方法注入

3.@Bean方法形参注入

4.直接在@Bean方法上使用@ConfigurationProperties(prefix="jdbc")

 

1.@RestController

2.@EnableAutoConfiguration

3.ComponenScan

4.SpringBootApplication=================>经常使用

5.SpringBootConfiguration

6.@Configuration=================>经常使用

7.@PropertySource

8.@Bean=================>经常使用

9.@Value

10.ConfigurationPropertion=================>经常使用

11.EnableConfigurationProperties=================>经常使用