//相对路径
String rootPath = ServletActionContext.getRequest().getContextPath();
//绝对路径
String rootPath = ServletActionContext.getServletContext().getRealPath("");
//相对路径
String rootPath = ServletActionContext.getRequest().getContextPath();
//绝对路径
String rootPath = ServletActionContext.getServletContext().getRealPath("");