struts2取得项目路径

struts2获得项目路径ActionContext ac ActionContext.getContext()ServletContext sc (ServletContex

struts2获得项目路径
ActionContext ac = ActionContext.getContext();
ServletContext sc = (ServletContext) ac.get(ServletActionContext.SERVLET_CONTEXT);
String path = sc.getRealPath("/");