Dom4j 操作文件,文件相对路径的问题

System.out.println("xml路径:"+ServletActionContext.getServletContext().getRealPath("/zxdc/xml")+File.separatorChar+"provinceCode.xml");
ServletActionContext.getServletContext().getRealPath("/");

  得到项目下webroot/ 这个路径 是在服务器上的。

posted @ 2014-05-14 10:35  dowa235  阅读(344)  评论(0编辑  收藏  举报