Struts2的Action中取得request,response,session等对象的方法
方法如下:
HttpServletRequest request =(HttpServletRequest)ActionContext.getContext().get(ServletActionContext.HTTP_REQUEST);
HttpServletResponse response =HttpServletResponse)ActionContext.getContext().get(ServletActionContext.HTTP_RESPONSE);
//ServletActionContext.APPLICATION;
//ServletActionContext.SESSION;
//ServletActionContext.PAGE_CONTEXT;
HttpServletResponse response =HttpServletResponse)ActionContext.getContext().get(ServletActionContext.HTTP_RESPONSE);
//ServletActionContext.APPLICATION;
//ServletActionContext.SESSION;
//ServletActionContext.PAGE_CONTEXT;