首页 > 编程语言 > 详细

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

时间:2015-03-13 18:42:49      阅读:265      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!