62,614
社区成员
发帖
与我相关
我的任务
分享
String imgBasePath = "/../FileData/images/";
//根目录路径,可以指定绝对路径
String rootPath = pageContext.getServletContext().getRealPath("\\") + imgBasePath;
//根目录URL,可以指定绝对路径
String rootUrl = request.getContextPath() + imgBasePath;
System.out.println(rootPath + "\t" + rootUrl);