第一种:
ActionContext ct=ActionContext.getContext();
HttpServletResponse response = (HttpServletResponse)ct.get(ServletActionContext.HTTP_RESPONSE);
HttpServletRequest request = (HttpServletRequest)ct.get(ServletActionContext.HTTP_REQUEST);
第二种:
HttpServletRequest request = ServletActionContext.getRequest();
HttpServletResponse response = ServletActionContext.getResponse();