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

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

实现 ApplicationListener<ContextRefreshedEvent> 来实现。

@Component
public class StartSysListener implements ApplicationListener<ContextRefreshedEvent> {



}
posted @ 2020-07-13 16:02  huiy_小溪  阅读(1726)  评论(0编辑  收藏  举报