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