Action类中代码:
ActionContext context = ActionContext.getContext();
HttpServletRequest request = (HttpServletRequest) context.get(ServletActionContext.HTTP_REQUEST);
String path=request.getSession().getServletContext().getRealPath("");
Action类中代码:
ActionContext context = ActionContext.getContext();
HttpServletRequest request = (HttpServletRequest) context.get(ServletActionContext.HTTP_REQUEST);
String path=request.getSession().getServletContext().getRealPath("");