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.youkuaiyun.com/arui_email/article/details/8135502
java 获取服务器端的webapps路径
最新推荐文章于 2025-06-11 14:15:59 发布