ITeye博客

spring

共 1 篇文章

spring事件机制-onApplicationEvent执行两次

一、case复现 事件定义 public class MyEvent extends ApplicationEvent { public MyEvent(Object object) { super(object); } } 监听定义 @Component public class MyListener implements ApplicationListener<MyEvent> { @Override public void onApplicationEvent(MyEvent event) { System.out.println("myEvent occured msg : " + …

2017-12-06 13:00 · spring · Spring