jsp内置对象(三)-----response对象

response对象
  response对象包含了响应客户端请求的有关信息,但在JSP中很少直接用到它。他是HttpServletResponse类的实例,response对象具有页面作用域,即访问一个页面时,该页面内的response对象只能对这次访问有效,其他页面的response对象对当前页面无效。
常用方法如下:
String getCharacterEncoding()返回响应的是何种字符编码;
void setContentType(String type)设置响应的MIME类型;
PrintWriter getwriter()返回可以向客户端输出一个对象;
sendRedirrect(java.lang.String.location)重定义客户端的请求;

posted @ 2017-02-09 00:12  mYunYu  阅读(153)  评论(0编辑  收藏  举报