首页 > 编程语言 > 详细

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

时间:2016-02-17 20:58:12      阅读:261      评论: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://www.cnblogs.com/yxwkf/p/5196415.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!