HttpServletRequest
setCharacterEncoding("utf-8");
getPrameter();
getPrameterValues();
setAttribute("name",value);
getAttribute("name");
request.getRequestDispatcher("").forward(request,response);
HttpServletResponse
setContentType("text/html;charset=utf-8");
setCharacterEncoding("utf-8");
getWriter();
getOutputStream();
setCharacterEncoding("utf-8");
getPrameter();
getPrameterValues();
setAttribute("name",value);
getAttribute("name");
request.getRequestDispatcher("").forward(request,response);
HttpServletResponse
setContentType("text/html;charset=utf-8");
setCharacterEncoding("utf-8");
getWriter();
getOutputStream();
sendRedirect("url");
HttpServletRequest :
web客户端向web服务器发送请求。请求内容可以概括为1请求行;2请求消息头;3消息正文。ServletAPI中定义了ServletRequest接口
HttpServletResponse:
web服务器反馈给web客户端的http响应。响应包含1状态行;2响应消息头;3消息正文。
url重定向=客户端跳转(快);两次请求消息不同;response.sendRedirect();
请求转发=服务器内部跳转(慢)第二次请求包含第一次请求的消息;request.getRequestdispachar().forward();