您的位置:首页 > 编程语言 > Java开发

java 动态获取web应用的部署路径

2016-02-17 20:00 393 查看
public static String DEPLOY_PATH = null;
static
{
String CurrentClassFilePath = Constant.class.getResource("").getPath();
int lastpath = CurrentClassFilePath.lastIndexOf("WEB-INF/");
DEPLOY_PATH = CurrentClassFilePath.substring(0, lastpath);
}


參考:http://blog.sina.com.cn/s/blog_6f3da9650101d70r.html

http://tech.ddvip.com/2011-11/1322014194170006.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: