1、response对象设置响应行状态码:

 protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    response.setStatus();
    }

response对响应的设置-LMLPHP

2、response对象添加响应头:

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {Date date=new Date(121344444);response.addHeader("zzz","I love JAVA.");response.addIntHeader("myself",22);response.addDateHeader("Time:",date.getTime());}

response对响应的设置-LMLPHP

3、response对象设置响应头:

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    Date date=new Date(121344444);
    response.addHeader("zzz","I love JAVA.");
    response.addIntHeader("myself",22);
    response.addDateHeader("Time:",date.getTime());
    response.setIntHeader("myself",23);
    }

response对响应的设置-LMLPHP

05-11 01:37