读书人

struts2中运用request

发布时间: 2012-10-09 10:21:45 作者: rapoo

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中不能自动应用)

读书人网 >软件架构设计

热点推荐