Spring载入配置文件applicationContext.xml的几种方式
第一种方式:
ClassPathResource cpr = new ClassPathResource("applicationContext.xml");
XmlBeanFactory factory = new XmlBeanFactory(cpr);
Person chinese = (Person) factory.getBean("chinese");//参数为配置文件中的i
原创
2013-04-14 12:06:57 ·
2092 阅读 ·
0 评论