16. spring的监听器

Spring的监听器是基于观察者模式

如何利用ApplicationContextAware,ApplicationListener,ApplicationEvent等接口实现自定义事件以及事件监听

https://blog.csdn.net/blueboz/article/details/49949573

Spring中定义好的几种事件
ContextClosedEvent(容器关闭时) 
ContextRefreshedEvent(容器刷新是) 
ContextStartedEvent(容器启动时候) 
ContextStoppedEvent(容器停止的时候)

扩展:

ServletContextListener接口

Spring MVC中常用的监听器

扫描二维码关注公众号,回复: 2309940 查看本文章

猜你喜欢

转载自www.cnblogs.com/GrimMjxCl/p/9351157.html