获取项目中的一些路径

 //   /F:/apache-tomcat-6.0.20/webapps/uploadify/WEB-INF/classes/download/

		String path = this.getClass().getResource("").getPath();
		 //   /F:/apache-tomcat-6.0.20/webapps/uploadify/WEB-INF/classes/
		String path11 = this.getClass().getResource("/").getPath();
		// /uploadify
		String path12 = request.getContextPath();
		
		// F:\\apache-tomcat-6.0.20\\webapps\\uploadify\\
		ServletContext s1=this.getServletContext();
		String temp = s1.getRealPath("/"); 
		System.out.println(temp);  // 



发布了167 篇原创文章 · 获赞 321 · 访问量 58万+

猜你喜欢

转载自blog.csdn.net/mazhimazh/article/details/41864423
今日推荐