Response
ServletRresponse/HttpServletRespon
//清缓存。
//HTML的清缓存
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
response.setHeader("Pragma","No-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0);
response.setHeader(arg0, arg1);
response.setDateHeader(arg0, arg1);
//设置响应输出类型。
response.setContentType("text/html");
//获取输出流。
PrintWriter out = response.getWriter();
//获取输入流与输出流(文件上传与下载)
request.getInputStream/response.getOutputStream();
//Cookie的操作
request.getCookie()/response.addCookie(arg0);
//请求转发,重定向。
注意路径的写法区别:
request.getRequestDispatcher()/response.sendRedirect(arg0);
//Response的编码问题:
response.setCharacterEncoding(arg0);