获取项目部署路径
程序员文章站
2022-05-18 12:13:33
...
Action类中代码:
ActionContext context = ActionContext.getContext();
HttpServletRequest request = (HttpServletRequest) context.get(ServletActionContext.HTTP_REQUEST);
String path=request.getSession().getServletContext().getRealPath("");