日期:2014-05-17  浏览次数:20626 次

如何得到WEB-INF下的xml文件
WebRoot
  ---WEB-INF
  ---reqXml
  ---cust.xml


写一个java类、怎么得到cust.xml文件?

------解决方案--------------------
Java code

String propsFile =Test.class.getResource("/").toString().replace("file:", "");
        propsFile =    propsFile.substring(0,propsFile.indexOf("WEB-INF"))+"WEB-INF/cust.xml";