获取webRoot路径的方法

String webRootPath=request.getSession().getServletContext().getRealPath("/");
 webRootPath

    String uploadPath="download\\dadan\\";
            //uploadPath附加传入的路径,组成一个上传的完整路径
            uploadPath=webRootPath+uploadPath;

 

posted @ 2018-08-16 17:26  闭眼的鱼  阅读(1648)  评论(0编辑  收藏  举报