【发布时间】:2010-01-16 04:28:43
【问题描述】:
我想使用 BeanFactory 创建 bean,但遇到异常:java.io.FileNotFoundException: \\WEB-INF\businesscaliber-servlet.xml。
Resource res = new FileSystemResource("//WEB-INF//businesscaliber-servlet.xml");
BeanFactory factory = new XmlBeanFactory(res);
if (factory != null && beanId != null) {
obj = factory.getBean(beanId);
}
他正在使用这个
ApplicationContext ctx = new FileSystemXmlApplicationContext("classpath*:/WEB-INF/businesscaliber-servlet.xml");
【问题讨论】: