struts2 Action中获取request, response对象的方法

 

 strus2 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;       
 
 

你可能感兴趣的:(response)