码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2015-03-13 18:45:02      阅读:146      评论:0      收藏:0      [点我收藏+]

标签:

	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

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

标签:

原文地址:http://blog.csdn.net/coslay/article/details/44244473

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!