网站公告列表

  没有公告

加入收藏
设为首页
联系站长
您现在的位置: 网络学院 >> 程序设计 >> Java编程 >> 文章正文
  javax.servlet.servletresponsewrapper翻译            【字体:
javax.servlet.servletresponsewrapper翻译
作者:佚名    文章来源:不详    点击数:    更新时间:2007-7-1    
 
JavaTM 2 Platform
Ent. Ed. v1.4

javax.servlet
Class ServletResponseWrapper

java.lang.Object extended byjavax.servlet.ServletResponseWrapper
All Implemented Interfaces:
ServletResponse
Direct Known Subclasses:
HttpServletResponseWrapper

public class ServletResponseWrapper
extends Object
implements ServletResponse

Provides a convenient implementation of the ServletResponse interface that can be subclassed by developers wishing to adapt the response from a Servlet. This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped response object. 提供了一种实现ServletResponse接口的便捷方式,开发人员想采用来自Servlet的响应的话, 可以对其子类化。
正在装载数据……
该类实现了包装或装饰模式。方法默认调用经过包装的响应对象。

Since:
v 2.3
Version:
$Version$
Author:
Various
See Also:
ServletResponse

Constructor Summary
ServletResponseWrapper(ServletResponse response)
          Creates a ServletResponse adaptor wrapping the given response object. 创建一个ServletResponse适配器,包装指定的响应对象。
 
Method Summary
 void flushBuffer()
          The default behavior of this method is to call flushBuffer() on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的flushBuffer()。
 int getBufferSize()
          The default behavior of this method is to return getBufferSize() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getBufferSize()。
 String getCharacterEncoding()
          The default behavior of this method is to return getCharacterEncoding() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getCharacterEncoding()。
 String getContentType()
          The default behavior of this method is to return getContentType() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getContentType()。
 Locale getLocale()
          The default behavior of this method is to return getLocale() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getLocale()。
 ServletOutputStream getOutputStream()
          The default behavior of this method is to return getOutputStream() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getOutputStream()。
 ServletResponse getResponse()
          Return the wrapped ServletResponse object. 返回经过包装的ServletResponse对象。
 PrintWriter getWriter()
          The default behavior of this method is to return getWriter() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getWriter()。
 boolean isCommitted()
          The default behavior of this method is to return isCommitted() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的isCommitted()。
 void reset()
          The default behavior of this method is to call reset() on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的reset()。
 void resetBuffer()
          The default behavior of this method is to call resetBuffer() on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的resetBuffer()。
 void setBufferSize(int size)
          The default behavior of this method is to call setBufferSize(int size) on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的setBufferSize(int size)。
 void setCharacterEncoding(String charset)
          The default behavior of this method is to call setCharacterEncoding(String charset) on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的setCharacterEncoding(String charset)。
 void setContentLength(int len)
          The default behavior of this method is to call setContentLength(int len) on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的setContentLength(int len)。
 void setContentType(String type)
          The default behavior of this method is to call setContentType(String type) on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的setContentType(String type)。
 void setLocale(Locale loc)
          The default behavior of this method is to call setLocale(Locale loc) on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的setLocale(Locale loc)。
 void setResponse(ServletResponse response)
          Sets the response being wrapped. 设置要包装的响应。
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletResponseWrapper

public ServletResponseWrapper(ServletResponse response)
Creates a ServletResponse adaptor wrapping the given response object. 创建一个ServletResponse适配器,包装指定的响应对象。

 

Throws:
IllegalArgumentException - if the response is null. 如果响应为null时抛出。
Method Detail

getResponse

public ServletResponse getResponse()
Return the wrapped ServletResponse object. 返回经过包装的ServletResponse对象。

 


setResponse

public void setResponse(ServletResponse response)
Sets the response being wrapped. 设置要包装的响应。

 

Throws:
IllegalArgumentException - if the response is null. 如果响应为null时抛出。

setCharacterEncoding

public void setCharacterEncoding(String charset)
The default behavior of this method is to call setCharacterEncoding(String charset) on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的setCharacterEncoding(String charset)。

 

Specified by:
setCharacterEncoding in interface ServletResponse
Parameters:
charset - a String specifying only the character set defined by IANA Character Sets (http://www.iana.org/assignments/character-sets) String,只表示由IANA字符集(http://www.iana.org/assignments/character-sets)定义的字符集
Since:
2.4
See Also:
#setLocale

getCharacterEncoding

public String getCharacterEncoding()
The default behavior of this method is to return getCharacterEncoding() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getCharacterEncoding()。

 

Specified by:
getCharacterEncoding in interface ServletResponse
Returns:
a String specifying the name of the character encoding, for example, UTF-8 String,表示字符编码名称,比如UTF-8

getOutputStream

public ServletOutputStream getOutputStream() throws IOException
The default behavior of this method is to return getOutputStream() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getOutputStream()。

 

Specified by:
getOutputStream in interface ServletResponse
Returns:
a ServletOutputStream for writing binary data 输出二进制数据的ServletOutputStream
Throws:
IOException - if an input or output exception occurred 如果发生输入输出异常时抛出
See Also:
ServletResponse.getWriter()

getWriter

public PrintWriter getWriter() throws IOException
The default behavior of this method is to return getWriter() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getWriter()。

 

Specified by:
getWriter in interface ServletResponse
Returns:
a PrintWriter object that can return character data to the client PrintWriter对象,可以返回客户端的字符数据
Throws:
IOException - if an input or output exception occurred 如果发生输入输出异常时抛出
See Also:
ServletResponse.getOutputStream(), ServletResponse.setCharacterEncoding(java.lang.String)

setContentLength

public void setContentLength(int len)
The default behavior of this method is to call setContentLength(int len) on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的setContentLength(int len)。

 

Specified by:
setContentLength in interface ServletResponse
Parameters:
len - an integer specifying the length of the content being returned to the client; sets the Content-Length header 整数,表示返回给客户端的内容长度;设置Content-Length头

setContentType

public void setContentType(String type)
The default behavior of this method is to call setContentType(String type) on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的setContentType(String type)。

 

Specified by:
setContentType in interface ServletResponse
Parameters:
type - a String specifying the MIME type of the content String,表示内容的MIME类型
See Also:
ServletResponse.setLocale(java.util.Locale), ServletResponse.setCharacterEncoding(java.lang.String), ServletResponse.getOutputStream(), ServletResponse.getWriter()

getContentType

public String getContentType()
The default behavior of this method is to return getContentType() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getContentType()。

 

Specified by:
getContentType in interface ServletResponse
Returns:
a String specifying the content type, for example, text/html; charset=UTF-8, or null String,表示内容类型,比如text/html; charset=UTF-8或者为null
Since:
2.4

setBufferSize

public void setBufferSize(int size)
The default behavior of this method is to call setBufferSize(int size) on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的setBufferSize(int size)。

 

Specified by:
setBufferSize in interface ServletResponse
Parameters:
size - the divferred buffer size 采用的缓存大小
See Also:
ServletResponse.getBufferSize(), ServletResponse.flushBuffer(), ServletResponse.isCommitted(), ServletResponse.reset()

getBufferSize

public int getBufferSize()
The default behavior of this method is to return getBufferSize() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getBufferSize()。

 

Specified by:
getBufferSize in interface ServletResponse
Returns:
the actual buffer size used 实际使用的缓存大小
See Also:
ServletResponse.setBufferSize(int), ServletResponse.flushBuffer(), ServletResponse.isCommitted(), ServletResponse.reset()

flushBuffer

public void flushBuffer() throws IOException
The default behavior of this method is to call flushBuffer() on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的flushBuffer()。

 

Specified by:
flushBuffer in interface ServletResponse
Throws:
IOException
See Also:
ServletResponse.setBufferSize(int), ServletResponse.getBufferSize(), ServletResponse.isCommitted(), ServletResponse.reset()

isCommitted

public boolean isCommitted()
The default behavior of this method is to return isCommitted() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的isCommitted()。

 

Specified by:
isCommitted in interface ServletResponse
Returns:
a boolean indicating if the response has been committed 布尔值,表示响应是否被提交
See Also:
ServletResponse.setBufferSize(int), ServletResponse.getBufferSize(), ServletResponse.flushBuffer(), ServletResponse.reset()

reset

public void reset()
The default behavior of this method is to call reset() on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的reset()。

 

Specified by:
reset in interface ServletResponse
See Also:
ServletResponse.setBufferSize(int), ServletResponse.getBufferSize(), ServletResponse.flushBuffer(), ServletResponse.isCommitted()

resetBuffer

public void resetBuffer()
The default behavior of this method is to call resetBuffer() on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的resetBuffer()。

 

Specified by:
resetBuffer in interface ServletResponse
See Also:
ServletResponse.setBufferSize(int), ServletResponse.getBufferSize(), ServletResponse.isCommitted(), ServletResponse.reset()

setLocale

public void setLocale(Locale loc)
The default behavior of this method is to call setLocale(Locale loc) on the wrapped response object. 该方法的默认行为是调用经过包装的响应对象的setLocale(Locale loc)。

 

Specified by:
setLocale in interface ServletResponse
Parameters:
loc - the locale of the response 响应的locale
See Also:
ServletResponse.getLocale(), ServletResponse.setContentType(java.lang.String), ServletResponse.setCharacterEncoding(java.lang.String)

getLocale

public Locale getLocale()
The default behavior of this method is to return getLocale() on the wrapped response object. 该方法的默认行为是返回经过包装的响应对象的getLocale()。

 

Specified by:
getLocale in interface ServletResponse
See Also:
ServletResponse.setLocale(java.util.Locale)

JavaTM 2 Platform
Ent. Ed. v1.4

Submit a bug or feature

Copyright 2003 Sun Microsystems, Inc. All rights reserved.

站内文章搜索 高级搜索
文章录入:admin    责任编辑:admin 
  • 上一篇文章:

  • 下一篇文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关文章
     用java实现web服务器
     用java快速开发linux gu…
     正则表达式分解siemens交…
     [portal参考手册]目录
     jsp中调用oracle存储过程…
  • JSP中JavaBean的生命周期

  • Java Swing实现俄罗斯方块

  • 快速、简便使用AJAX技术的三…

  • java异常处理机制的深入理解

  • [转]Java堆和栈的区别 经典总…

  • 关于java Applet

  • java 设计工厂模式

  • Core Java 之旅

  • 专访Java之父:Java未来的发…

  • 开发手记---JAVA数据库连接池

  •   网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    网络学院©2007 www.23book.net
    为您提供web编程,vb编程,vc编程,服务器架设管理,数据库设计等方面的知识 站长:David