struts2获取tomcat中项目路径

//获取项目路径
		ActionContext ac = ActionContext.getContext();   
		ServletContext sc = (ServletContext) ac.get(ServletActionContext.SERVLET_CONTEXT);   
		WEB_ROOT_PATH = sc.getRealPath("/");
 

猜你喜欢

转载自maoyifa100.iteye.com/blog/1743617