获取J2ee工程在应用服务器(如tomcat)下的物理路径
ActionContext ac = ActionContext.getContext();
ServletContext sc = (ServletContext) ac.get(ServletActionContext.SERVLET_CONTEXT);
String path = sc.getRealPath("/");
发布时间: 2013-01-26 13:47:02 作者: rapoo
获取J2ee工程在应用服务器(如tomcat)下的物理路径
ActionContext ac = ActionContext.getContext();
ServletContext sc = (ServletContext) ac.get(ServletActionContext.SERVLET_CONTEXT);
String path = sc.getRealPath("/");