springboot:SpringApplication.run之后的代码没有执行

在eclipse中运行,SpringApplication.run之后的代码是可以执行的,但是放在tomcat中运行不行。

实现 ApplicationListener<ContextRefreshedEvent> 来实现。

@Component
public class StartSysListener implements ApplicationListener<ContextRefreshedEvent> {



}
原文地址:https://www.cnblogs.com/huiy/p/13293716.html