1、类中某方法加注解@PostConstruct
2、实现InitializingBean接口,实现afterPropertiesSet方法
3、xml方式,bean标签里配置init-mothod属性,指向类中的方法。
他们的执行顺序是
1-@PostConstruct
2-实现InitializingBean中的afterPropertiesSet
3-xml方式
扫描二维码关注公众号,回复:
7876953 查看本文章
他们的执行顺序是
1-@PostConstruct
2-实现InitializingBean中的afterPropertiesSet
3-xml方式