1、response对象设置响应行状态码:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setStatus(); }
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());}
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); }