读书人

读取WEB-INF上的xml有关问题

发布时间: 2012-12-22 12:05:05 作者: rapoo

读取WEB-INF下的xml问题
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
InputStream flie = this.getClass().getResourceAsStream(
"WEB-INF/sac-price.xml");
Document doc = db.parse(flie);
} catch (Exception e) {
System.out.println(e.getMessage());
throw e;
}
catch抓住的错误是:InputStream cannot be null


检查了WEB-INF下面存在sac-price.xml

请问高手这是为啥????
也请教更好的方法。。。
[解决办法]
没人知道么?

读书人网 >J2EE开发

热点推荐