struts2获取tomcat中项目途径

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