struts2中获取项目所在的物理路径:
ActionContext ac = ActionContext.getContext(); ServletContext sc = (ServletContext) ac.get(ServletActionContext.SERVLET_CONTEXT); String path = sc.getRealPath("/");
磁盘.../项目名/WebRoot/