分享
 
 
 

javax.servlet.ServletResponseWrapper翻译

王朝java/jsp·作者佚名  2006-04-12
窄屏简体版  字體: |||超大  

[/url]

[url=file:///F:/资料/文字资料/j2ee-1.4_doc/apidocs/overview-summary.html]Overview

Package

Class

Tree

Deprecated

Index

Help

JavaTM 2 Platform

Ent. Ed. v1.4

PREV CLASS NEXT CLASS

FRAMES NO FRAMES

All Classes

SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

javax.servlet

Class ServletRequestWrapper

java.lang.Object

javax.servlet.ServletRequestWrapper

All Implemented Interfaces: ServletRequest Direct Known Subclasses: HttpServletRequestWrapper public class ServletRequestWrapper extends Object implements ServletRequest

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

Since: v 2.3 See Also: ServletRequest

Constructor Summary

ServletRequestWrapper(ServletRequest request)

Creates a ServletRequest adaptor wrapping the given request object. 创建一个ServletRequest适配器,包装指定的请求对象。

Method Summary

Object

getAttribute(String name)

The default behavior of this method is to call getAttribute(String name) on the wrapped request object. 该方法的默认行为是调用经过包装的请求对象的getAttribute(String name)。

Enumeration

getAttributeNames()

The default behavior of this method is to return getAttributeNames() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getAttributeNames()。

String

getCharacterEncoding()

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

int

getContentLength()

The default behavior of this method is to return getContentLength() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getContentLength()。

String

getContentType()

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

ServletInputStream

getInputStream()

The default behavior of this method is to return getInputStream() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getInputStream()。

String

getLocalAddr()

The default behavior of this method is to return getLocalAddr() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getLocalAddr()。

Locale

getLocale()

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

Enumeration

getLocales()

The default behavior of this method is to return getLocales() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getLocales()。

String

getLocalName()

The default behavior of this method is to return getLocalName() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getLocalName()。

int

getLocalPort()

The default behavior of this method is to return getLocalPort() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getLocalPort()。

String

getParameter(String name)

The default behavior of this method is to return getParameter(String name) on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getParameter(String name)。

Map

getParameterMap()

The default behavior of this method is to return getParameterMap() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getParameterMap()。

Enumeration

getParameterNames()

The default behavior of this method is to return getParameterNames() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getParameterNames()。

String[]

getParameterValues(String name)

The default behavior of this method is to return getParameterValues(String name) on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getParameterValues(String name)。

String

getProtocol()

The default behavior of this method is to return getProtocol() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getProtocol()。

BufferedReader

getReader()

The default behavior of this method is to return getReader() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getReader()。

String

getRealPath(String path)

The default behavior of this method is to return getRealPath(String path) on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getRealPath(String path)。

String

getRemoteAddr()

The default behavior of this method is to return getRemoteAddr() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getRemoteAddr()。

String

getRemoteHost()

The default behavior of this method is to return getRemoteHost() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getRemoteHost()。

int

getRemotePort()

The default behavior of this method is to return getRemotePort() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getRemotePort()。

ServletRequest

getRequest()

Return the wrapped request object. 返回包装的请求对象。

RequestDispatcher

getRequestDispatcher(String path)

The default behavior of this method is to return getRequestDispatcher(String path) on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getRequestDispatcher(String path)。

String

getScheme()

The default behavior of this method is to return getScheme() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getScheme()。

String

getServerName()

The default behavior of this method is to return getServerName() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getServerName()。

int

getServerPort()

The default behavior of this method is to return getServerPort() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getServerPort()。

boolean

isSecure()

The default behavior of this method is to return isSecure() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的isSecure()。

void

removeAttribute(String name)

The default behavior of this method is to call removeAttribute(String name) on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的removeAttribute(String name)。

void

setAttribute(String name, Object o)

The default behavior of this method is to return setAttribute(String name, Object o) on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的setAttribute(String name, Object o)。

void

setCharacterEncoding(String enc)

The default behavior of this method is to set the character encoding on the wrapped request object. 该方法的默认行为是设置经过包装的请求对象的字符编码。

void

setRequest(ServletRequest request)

Sets the request object being wrapped. 设置被包装的请求对象。

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ServletRequestWrapper

public ServletRequestWrapper(ServletRequest request)

Creates a ServletRequest adaptor wrapping the given request object. 创建一个ServletRequest适配器,包装指定的请求对象。

Throws: IllegalArgumentException - if the request is null 如果请求为null时抛出

Method Detail

getRequest

public ServletRequest getRequest()

Return the wrapped request object. 返回包装的请求对象。

setRequest

public void setRequest(ServletRequest request)

Sets the request object being wrapped. 设置被包装的请求对象。

Throws: IllegalArgumentException - if the request is null. 如果请求为null时抛出。

getAttribute

public Object getAttribute(String name)

The default behavior of this method is to call getAttribute(String name) on the wrapped request object. 该方法的默认行为是调用经过包装的请求对象的getAttribute(String name)。

Specified by: getAttribute in interface ServletRequestParameters: name - a String specifying the name of the attribute String,表示属性名称 Returns: an Object containing the value of the attribute, or null if the attribute does not exist Object,表示属性值,如果该属性不存在,返回null

getAttributeNames

public Enumeration getAttributeNames()

The default behavior of this method is to return getAttributeNames() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getAttributeNames()。

Specified by: getAttributeNames in interface ServletRequestReturns: an Enumeration of strings containing the names of the request's attributes 字符串的枚举,表示请求属性的名称

getCharacterEncoding

public String getCharacterEncoding()

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

Specified by: getCharacterEncoding in interface ServletRequestReturns: a String containing the name of the chararacter encoding, or null if the request does not specify a character encoding String,表示字符编码名称,如果请求未指定字符编码,返回null

setCharacterEncoding

public void setCharacterEncoding(String enc)

throws UnsupportedEncodingException

The default behavior of this method is to set the character encoding on the wrapped request object. 该方法的默认行为是设置经过包装的请求对象的字符编码。

Specified by: setCharacterEncoding in interface ServletRequestParameters: enc - a String containing the name of the chararacter encoding. String,表示字符编码名称。 Throws: UnsupportedEncodingException - if this is not a valid encoding 如果这是一个无效的编码时抛出

getContentLength

public int getContentLength()

The default behavior of this method is to return getContentLength() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getContentLength()。

Specified by: getContentLength in interface ServletRequestReturns: an integer containing the length of the request body or -1 if the length is not known 整数,表示请求体的长度,长度未知则为-1

getContentType

public String getContentType()

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

Specified by: getContentType in interface ServletRequestReturns: a String containing the name of the MIME type of the request, or null if the type is not known String,表示请求的MIME类型名称,如果类型未知,返回null

getInputStream

public ServletInputStream getInputStream()

throws IOException

The default behavior of this method is to return getInputStream() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getInputStream()。

Specified by: getInputStream in interface ServletRequestReturns: a ServletInputStream object containing the body of the request ServletInputStream对象,表示请求体 Throws: IOException - if an input or output exception occurred 如果发生输入输出异常时抛出

getParameter

public String getParameter(String name)

The default behavior of this method is to return getParameter(String name) on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getParameter(String name)。

Specified by: getParameter in interface ServletRequestParameters: name - a String specifying the name of the parameter String,表示参数名称 Returns: a String representing the single value of the parameter String,表示参数的唯一值 See Also: ServletRequest.getParameterValues(java.lang.String)

getParameterMap

public Map getParameterMap()

The default behavior of this method is to return getParameterMap() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getParameterMap()。

Specified by: getParameterMap in interface ServletRequestReturns: an immutable java.util.Map containing parameter names as keys and parameter values as map values. The keys in the parameter map are of type String. The values in the parameter map are of type String array. 一个不变的java.util.Map,key为参数名称,map值为参数值。 在参数map中key为String类型,值为String数组类型。

getParameterNames

public Enumeration getParameterNames()

The default behavior of this method is to return getParameterNames() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getParameterNames()。

Specified by: getParameterNames in interface ServletRequestReturns: an Enumeration of String objects, each String containing the name of a request parameter; or an empty Enumeration if the request has no parameters String对象的枚举,每一个String为请求参数的名称;如果请求不含参数,返回空枚举

getParameterValues

public String[] getParameterValues(String name)

The default behavior of this method is to return getParameterValues(String name) on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getParameterValues(String name)。

Specified by: getParameterValues in interface ServletRequestParameters: name - a String containing the name of the parameter whose value is requested String,请求值的参数名称 Returns: an array of String objects containing the parameter's values String对象数组,表示参数的值 See Also: ServletRequest.getParameter(java.lang.String)

getProtocol

public String getProtocol()

The default behavior of this method is to return getProtocol() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getProtocol()。

Specified by: getProtocol in interface ServletRequestReturns: a String containing the protocol name and version number String,表示协议名称和版本号

getScheme

public String getScheme()

The default behavior of this method is to return getScheme() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getScheme()。

Specified by: getScheme in interface ServletRequestReturns: a String containing the name of the scheme used to make this request String,表示用来生成请求的模式名称

getServerName

public String getServerName()

The default behavior of this method is to return getServerName() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getServerName()。

Specified by: getServerName in interface ServletRequestReturns: a String containing the name of the server String,表示服务器名称

getServerPort

public int getServerPort()

The default behavior of this method is to return getServerPort() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getServerPort()。

Specified by: getServerPort in interface ServletRequestReturns: an integer specifying the port number 整数,表示端口号

getReader

public BufferedReader getReader()

throws IOException

The default behavior of this method is to return getReader() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getReader()。

Specified by: getReader in interface ServletRequestReturns: a BufferedReader containing the body of the request BufferedReader,表示请求体 Throws: IOException - if an input or output exception occurred 如果发生输入输出异常时抛出 See Also: ServletRequest.getInputStream()

getRemoteAddr

public String getRemoteAddr()

The default behavior of this method is to return getRemoteAddr() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getRemoteAddr()。

Specified by: getRemoteAddr in interface ServletRequestReturns: a String containing the IP address of the client that sent the request String,表示发送请求的客户端IP地址

getRemoteHost

public String getRemoteHost()

The default behavior of this method is to return getRemoteHost() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getRemoteHost()。

Specified by: getRemoteHost in interface ServletRequestReturns: a String containing the fully qualified name of the client String,表示客户端全名称

setAttribute

public void setAttribute(String name,

Object o)

The default behavior of this method is to return setAttribute(String name, Object o) on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的setAttribute(String name, Object o)。

Specified by: setAttribute in interface ServletRequestParameters: name - a String specifying the name of the attribute String,表示属性名称 o - the Object to be stored 要保存的Object

removeAttribute

public void removeAttribute(String name)

The default behavior of this method is to call removeAttribute(String name) on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的removeAttribute(String name)。

Specified by: removeAttribute in interface ServletRequestParameters: name - a String specifying the name of the attribute to remove String,指定要删除的属性名称

getLocale

public Locale getLocale()

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

Specified by: getLocale in interface ServletRequestReturns: the preferred Locale for the client 客户端采用的Locale

getLocales

public Enumeration getLocales()

The default behavior of this method is to return getLocales() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getLocales()。

Specified by: getLocales in interface ServletRequestReturns: an Enumeration of preferred Locale objects for the client 客户端采用的Locale对象枚举

isSecure

public boolean isSecure()

The default behavior of this method is to return isSecure() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的isSecure()。

Specified by: isSecure in interface ServletRequestReturns: a boolean indicating if the request was made using a secure channel 布尔值,表示请求是否使用安全通道发出

getRequestDispatcher

public RequestDispatcher getRequestDispatcher(String path)

The default behavior of this method is to return getRequestDispatcher(String path) on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getRequestDispatcher(String path)。

Specified by: getRequestDispatcher in interface ServletRequestParameters: path - a String specifying the pathname to the resource. If it is relative, it must be relative against the current servlet. String,表示资源路径名。如果是相对的,必须相对于当前servlet。 Returns: a RequestDispatcher object that acts as a wrapper for the resource at the specified path, or null if the servlet container cannot return a RequestDispatcher RequestDispatcher对象,作为指定路径的资源包装器,如果servlet容器不能返回RequestDispatcher, 那么返回null See Also: RequestDispatcher, ServletContext.getRequestDispatcher(java.lang.String)

getRealPath

public String getRealPath(String path)

The default behavior of this method is to return getRealPath(String path) on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getRealPath(String path)。

Specified by: getRealPath in interface ServletRequest

getRemotePort

public int getRemotePort()

The default behavior of this method is to return getRemotePort() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getRemotePort()。

Specified by: getRemotePort in interface ServletRequestSince: 2.4

getLocalName

public String getLocalName()

The default behavior of this method is to return getLocalName() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getLocalName()。

Specified by: getLocalName in interface ServletRequestReturns: a String containing the host name of the IP on which the request was received. String,表示收到请求的IP主机名。 Since: 2.4

getLocalAddr

public String getLocalAddr()

The default behavior of this method is to return getLocalAddr() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getLocalAddr()。

Specified by: getLocalAddr in interface ServletRequestReturns: a String containing the IP address on which the request was received. String,表示收到请求的IP地址。 Since: 2.4

getLocalPort

public int getLocalPort()

The default behavior of this method is to return getLocalPort() on the wrapped request object. 该方法的默认行为是返回经过包装的请求对象的getLocalPort()。

Specified by: getLocalPort in interface ServletRequestReturns: an integer specifying the port number 整数,表示端口号 Since: 2.4 [/url]

[url=file:///F:/资料/文字资料/j2ee-1.4_doc/apidocs/overview-summary.html]Overview

Package

Class

Tree

Deprecated

Index

Help

JavaTM 2 Platform

Ent. Ed. v1.4

PREV CLASS NEXT CLASS

FRAMES NO FRAMES

All Classes

SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Submit a bug or feature

Copyright 2003 Sun Microsystems, Inc. All rights reserved.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有