Struts2的Action中取得request,response,session等对象的方法

方法如下:

HttpServletRequest request =(HttpServletRequest)ActionContext.getContext().get(ServletActionContext.HTTP_REQUEST);       
      
HttpServletResponse response 
=HttpServletResponse)ActionContext.getContext().get(ServletActionContext.HTTP_RESPONSE);       
       
//ServletActionContext.APPLICATION;       
//ServletActionContext.SESSION;       
//ServletActionContext.PAGE_CONTEXT;      

 

posted on 2009-06-12 11:52  Love2009  阅读(405)  评论(0编辑  收藏  举报

导航