session.getServletContext().getRealPath("");
但是 getRealPath("a"+File.separator);出来的结果是没有最后一个File.separator的;
getRealPath方法给去掉了;如果需要增加最后一个File.separator,自己得到路径之后
再增加:path = path + File.separator;
本文共 194 字,大约阅读时间需要 1 分钟。
session.getServletContext().getRealPath("");
但是 getRealPath("a"+File.separator);出来的结果是没有最后一个File.separator的;
getRealPath方法给去掉了;如果需要增加最后一个File.separator,自己得到路径之后
再增加:path = path + File.separator;
转载地址:http://eplhl.baihongyu.com/