javax.servlet
Intece ServletResponse
All Known Subinteces:
HttpServletResponse
All Known Implementing Classes:
HttpServletResponseWrapper, ServletResponseWrapper
2.ServletResponse的API
1)java.lang.String getCharacterEncoding()
Returns the name of the character encoding (MIME charset) used for the body sent in this response.
2)void setCharacterEncoding(java.lang.String charset)
Sets the character encoding (MIME charset) of the response being sent to the client, for example, to UTF-8.设置响应的编码字符集为charset
3)java.lang.String getContentType()
Returns the content type used for the MIME body sent in this response.
4)void setContentType(java.lang.String type)
Sets the content type of the response being sent to the client, if the response has not been committed yet.设置响应的内容类型为type.
5)java.io.PrintWriter getWriter()
Returns a PrintWriter object that can send character text to the client返回一个PrintWriter对象,利用这个对象可以向客户端输出文本。这个对象的作用类于JSP的内置对象out。
5)ServletOutputStream getOutputStream()
Returns a ServletOutputStream suitable for writing binary data in the response
6)x boolean isCommitted()
Returns a boolean indicating if the response has been committed.
Extends the ServletResponse intece to provide HTTP-specific functionality in sending a response. For example, it has methods to access HTTP headers and cookies.
The servlet container creates an HttpServletResponse object and passes it as an argument to the servlet's service methods (doGet, doPost, etc).
1.HttpServletResponse的类结构
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/ruanjian/article-36808-11.html
既然“这两个涉及到美国自身的安全
麻麻今天去看小王子