web项目获取当前tomcat webapps目录
String directory = NoScanAction.class.getClassLoader().getResource("").getPath();
String rootPath1 = ServletActionContext.getServletContext().getRealPath("/");
String path = rootPath1.substring(0, rootPath1.indexOf("webapps")) + "webapps/upload/";

浙公网安备 33010602011771号