从WebRoot中读取spring配置文件

2019-04-15 17:01发布

[img]http://dl.iteye.com/upload/picture/pic/114776/7cb30028-51c2-3b7d-8d09-5fde9acf155a.jpg[/img]
ApplicationContext ctx = new FileSystemXmlApplicationContext(
"/WebRoot/spring/applicationContext.xml");

// BeanName theBean = (BeanName) ctx.getBean("theBean");