1、什么是springboot?为什么有Spring还要弄个springboot出来?
Spring Boot 是 Spring 开源组织下的子项目,是 Spring 组件一站式解决方案,主要是简化了使用 Spring 的难度,简省了繁重xml的配置,提供了各种启动器,在运行过程中自定配置, 开发者能快速上手。
2、springboot启动流程?
创建springbootApplication对象,设置属性值
- 实例化springbootApplication对象
- 获取当前应用的启动类型。
2.1:通过判断当前classpath是否加载servlet类,返回servlet web启动方式。
2.2:webApplicationType三种类型:
1.reactive:响应式启动(spring5新特性)
2.none:即不嵌入web容器启动(springboot放在外部服务器运行 )
3.servlet:基于web容器进行启动
- 读取springboot下的META-INFO/spring.factories文件,