java web获取路径

class

URL save = Thread.currentThread().getContextClassLoader().getResource("");
String str = save.toString();
str = str.substring(6) +childPath;

 

webapp

String excelPath = request.getSession().getServletContext().getRealPath("dddd);
excelpath=D:\0pentakill\0code\ycgwl\pp\rosefinch-ppTest-web\target\webapp\dddd

 

posted @ 2018-01-28 14:14  zfzf1  阅读(113)  评论(0)    收藏  举报