

DispatchServlet的功能
- 捕获特定格式的Url请求
- 初始化DispatchServlet的上下问,处理相关逻辑
-
初始化Spring MVC的各个组成部件,装配到DispatchServlet中
image.png
@SpringBootApplication注解
有以下三个注解组成
- @Configuration
- @EnableAutoConfiguration
- @ComponentScan 扫描包下@Component注解的类,并交由Spring 管理
@Configuration

SpingBoot 应用程序启动后执行的操作
默认情况下ApplicationRunner 执行优先于CommandLineRunner
@Order标识执行的顺序


Profiles配置文件
spring.profiles.active 使用那个配置

配置文件封装为实体类


定时任务
- @EnableScheduling 开启定时任务
-
@Scheduled 设置定时任务
image.png
image.png
网友评论