首页 > 代码库 > 获取HttpServletRequest request对象 和 HttpServletResponse response对象

获取HttpServletRequest request对象 和 HttpServletResponse response对象

方法一:       HttpServletRequest request = Struts2Utils.getRequest();      

                 HttpServletResponse response = Struts2Utils.getResponse();

方法二:         HttpServletRequest request = ServletActionContext.getRequest();      

                   HttpServletResponse response = ServletActionContext.getResponse();

 

 

 String billId = Struts2Utils.getParameter("id").trim();

获取HttpServletRequest request对象 和 HttpServletResponse response对象