Spring bean 实现生命周期的三种解决方案 解决方案一:通过XML配置文件实现:(标签bean的属性init-method和destroy-method) beans.xml: <beans><bean id="bean" class=……