首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

怎么得到服务器路径(weblogic-domain)

2012-11-05 
如何得到服务器路径(weblogic-domain)对于如何在weblogic中得到web项目路径问题,是很常见的;前些日子用到

如何得到服务器路径(weblogic-domain)
对于如何在weblogic中得到web项目路径问题,是很常见的;
前些日子用到了,就记录下大家分享下。

public String getWebInfPath() throws IllegalAccessException {String path = getClass().getProtectionDomain().getCodeSource().getLocation().getPath();if (path.indexOf("WEB-INF") > 0) {path = path.substring(1, path.indexOf("WEB-INF") + 15);} else {throw new IllegalAccessException("路径获取错误");}return path;}

热点排行