/** * 获取服务器端的webapps路径 * @return */ public String findServerPath(){ String classPath = this.getClass().getClassLoader().getResource("/").getPath(); try { classPath =URLDecoder.decode(classPath, "gb2312"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } String[] strPath = classPath.split("/"); String path = ""; for(int i = 0;i < strPath.length ; i++){ if(i > 0 && i <= 3){ path = path + strPath[i]+"/"; } } return path; }
获取服务器端的webapps路径
最新推荐文章于 2021-04-28 19:04:36 发布