spring初始化bean之后的3种回调方式

1、类中某方法加注解@PostConstruct

2、实现InitializingBean接口,实现afterPropertiesSet方法

3、xml方式,bean标签里配置init-mothod属性,指向类中的方法。

 

 他们的执行顺序是

1-@PostConstruct

2-实现InitializingBean中的afterPropertiesSet

3-xml方式

原文地址:https://www.cnblogs.com/hkdpp/p/11872712.html