当我在bean中配置了<property name="dao" ref="steerdao"></property>后为什么只调用了初始化方法,并没有调用destroy()方法?
配置文件如下:
<bean name="chineseSteer" class="com.ly.spring.action.Chinese">
<property name="serivce" ref="steerService"></property>
</bean>
public class Chinese implements InitializingBean,DisposableBean{
public void show() {
serivce.chop();
}
@Override
public void destroy() throws Exception {
System.out.println("destroy()");
}
@Override
public void afterPropertiesSet() throws Exception {
System.out.println("afterPropertiesSet()");
}