implements ApplicationListener<ApplicationStartedEvent>
Author: ghj1040110333Created Jul 28, 2021Updated Dec 16, 2021
SpringBoot打包成war包后继承ApplicationListener类都无效了
SpringApplication builder = new SpringApplication(Application.class); builder.addListeners(new ApplicationListenerEnvironmentPrepared()); //extend ApplicationListener builder.addListeners(new ApplicationListenerFailed()); //extend ApplicationListener builder.addListeners(new ApplicationListenerPrepared()); //extend ApplicationListener builder.addListeners(new ApplicationListenerStarting()); //extend ApplicationListener
Source: 527515025/springBoot