ActionContext ac = ActionContext.getContext();
ServletContext sc = (ServletContext) ac.get(ServletActionContext.SERVLET_CONTEXT);
String path = sc.getRealPath("/");
System.out.println("new path := " + path);
Struts2获取当前项目的根目录
最新推荐文章于 2021-08-12 03:57:25 发布