博客【张光见】

胸纳幽兰,神容略若---张若兰

博客园 首页 新随笔 联系 订阅 管理

1)方式一

URI webPathTemp = Thread.currentThread().getContextClassLoader().getResource("").toURI();
 String webPath=String.valueOf(webPathTemp.getPath());
 webPath = webPath.substring(1,webPath.indexOf("WEB-INF"))+"out/zxjl";
 String templateFile=webPath+"/zxjl.dot";

2)方式二

String webPath = JSPUtil.class.getResource("").getPath();
   String xmlFile = webPath.substring(1,webPath.indexOf("WEB-INF"))+"out\\UpDownData.xml";

posted on 2008-08-13 15:02  willpower  阅读(1679)  评论(0编辑  收藏  举报