首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

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

2012-12-22 
读取WEB-INF下的xml问题try {DocumentBuilderFactory dbf DocumentBuilderFactory.newInstance()Docume

读取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

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

热点排行