weblogic失去项目绝对路径

weblogic得到项目绝对路径String path new DefaultResourceLoader().getClassLoader().getResource(/)

weblogic得到项目绝对路径
String path = new DefaultResourceLoader().getClassLoader().getResource("/").getPath();
path = URLDecoder.decode(path);
if (path.endsWith("/")) {
return path.substring(0, path.length() - 1);
} else {
return path;
}