67,550
社区成员




<bean id="knight" class="com.springinaction.knights.BraveKnight" init-method="init" destroy-method="destroy">
</bean>
public class BraveKnight implements Knight{
private void init(){
System.out.println("bean init");
}
private void destroy(){//never be invoked?
System.out.println("bean destroied");
}
}
ApplicationContext context=new ClassPathXmlApplicationContext("knights.xml");
Knight knight = (Knight) context.getBean("knight");