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 <= 4){
path = path + strPath[i]+"/";
}
}
return path;
}
原帖地址:
http://blog.csdn.net/arui_email/article/details/8135502
java 获取服务器端的webapps路径
最新推荐文章于 2021-03-06 11:12:52 发布