struts2中应用request
ActionContext ctx = ActionContext.getContext();
HttpServletRequest request = (HttpServletRequest) ctx
.get(ServletActionContext.HTTP_REQUEST);
HttpServletResponse response = (HttpServletResponse) ctx
.get(ServletActionContext.HTTP_RESPONSE);
(注:request是jsp中九大内置对象之一,servlet中可以应用,而struts中不能自动应用)