81,095
社区成员
发帖
与我相关
我的任务
分享
String strPathFile = application.getRealPath(request.getRequestURI());
out.println("文件的绝对路径:" + strPathFile+ "<br/>");
//结果 为C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\PRFQ\PRFQ\jsp\importfeedback.jsp
String strDirPath = new java.io.File(application.getRealPath(request.getRequestURI())).getParent();
out.println("目录的绝对路径:" + strDirPath + "<br/>");
//结果 为C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\PRFQ\PRFQ\jsp
strDirPath+"/../../jsp/import/"+file.getFileName()