String webRootPath=request.getSession().getServletContext().getRealPath("/");
webRootPath
String uploadPath="download\\dadan\\";
//uploadPath附加传入的路径,组成一个上传的完整路径
uploadPath=webRootPath+uploadPath;
原文:https://www.cnblogs.com/hmpcly/p/9488613.html