request.getSession().getServletContext().getRealPath(“upload“)的含义

request.getSession().getServletContext().getRealPath(“upload”)
获取到的路径是和WEB-INF文件夹同一层名为upload的文件夹的绝对路径

String path = request.getSession().getServletContext().getRealPath("");
获取到的路径是WEB-INF文件夹的上层目录的绝对路径

猜你喜欢

转载自blog.csdn.net/weixin_42594143/article/details/112548521