标签:response 添加 protect oge ade head pre oid ima
1、response对象设置响应行状态码:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setStatus(404); }
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); }
标签:response 添加 protect oge ade head pre oid ima
原文地址:https://www.cnblogs.com/zhai1997/p/11483234.html