/**
* 获取服务器WebRoot的绝对路径
* @return
*/
public String getWebRootPath(){
String classpath = this.getClass().getResource("SysConfig.class").toString();
String rootpath = classpath.substring(classpath.indexOf(":")+2, classpath.lastIndexOf("WEB-INF")).replaceAll("%20", " ");
return rootpath;
}
获取web服务器的根路径
最新推荐文章于 2020-11-01 13:40:40 发布