web项目获取当前tomcat webapps目录

String rootPath1 = ServletActionContext.getServletContext().getRealPath("/");
String path = rootPath1.substring(0, rootPath1.indexOf("webapps")) + "webapps/upload/";

猜你喜欢

转载自www.cnblogs.com/jdw12306/p/12518138.html
今日推荐