struts2 Action中获取request, response对象的方法
- ActionContext ctx = ActionContext.getContext();
- HttpServletRequest request = (HttpServletRequest)ctx.get(ServletActionContext.HTTP_REQUEST);
- HttpServletResponse response = (HttpServletResponse)ctx.get(ServletActionContext.HTTP_RESPONSE);
- //ServletActionContext.APPLICATION;
- //ServletActionContext.SESSION;
- //ServletActionContext.PAGE_CONTEXT;