标签:
1.创建ApplicationContext对象:
ApplicationContext context = new FileSystemXmlApplicationContext("D:/workspace/test/resources/applicationContext-resource.xml");
2.调用getBean方法(注意参数以xml配置中的bean的名字匹配):
trDAO = (ITestResultDAO) context.getBean("trDAO");
标签:
原文地址:http://www.cnblogs.com/nickhan/p/4221835.html