绝对路径:
String realPath = ServletActionContext.getServletContext().getRealPath("/upload/");
相对路径:
String saveUrl = ServletActionContext.getRequest().getContextPath()+ "/upload/";
绝对路径、相对路径(ServletActionContext)
最新推荐文章于 2022-04-20 13:46:31 发布
绝对路径:
String realPath = ServletActionContext.getServletContext().getRealPath("/upload/");
相对路径:
String saveUrl = ServletActionContext.getRequest().getContextPath()+ "/upload/";