芷的天地

JSP内置对象之二——response

response对象包含了响应客户请求的有关信息,但在JSP中很少直接用到它。它是HttpServletResponse类的实例。

序号                           方 法                          说 明
1  String                    getCharacterEncoding() 返回响应用的是何种字符编码
2  ServletOutputStream getOutputStream() 返回响应的一个二进制输出流
3  PrintWriter             getWriter() 返回可以向客户端输出字符的一个对象
4  void                       setContentLength(int len) 设置响应头长度
5  void                       setContentType(String type) 设置响应的MIME类型
6  sendRedirect(java.lang.String location) 重新定向客户端的请求

 

参考地址:http://edu.codepub.com/2009/1018/16461_2.php

posted on 2010-07-13 14:56    阅读(152)  评论(0编辑  收藏  举报

导航