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;
本文转自
http://lxy19791111.javaeye.com/blog/135771
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;
本文转自
http://lxy19791111.javaeye.com/blog/135771