SpringBoot启动后初始化
-
SpringBoot启动后初始化的几种方式汇总
目录一、静态代码块二、构造方法三、@PostConstruct四、InitializingBean 接口五、 @Bean 注解中的 initMethod六、 CommandLineRunner 接口七、ApplicationRunner 接口八、@EventListener事件九、SmartInitializingS[详细]
2025-04-28 10:36 分类:开发 SpringBoot启动后自动执行初始化任务的五种方法
目录导语一、为什么需要启动后自动执行方法二、六大实现方案全解析方案 1:@PostConstruct(简单初始化)方案 2:ApplicationRunner(参数解析增强)方案 3:ApplicationListener方案 4:CommandLineRunner(基础[详细]
2025-04-11 10:22 分类:开发