javax.servlet
クラス ServletRequestWrapper

java.lang.Object
  |
  +--javax.servlet.ServletRequestWrapper
すべての実装インタフェース:
ServletRequest
直系の既知のサブクラス:
HttpServletRequestWrapper

public class ServletRequestWrapper
extends java.lang.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.

導入されたバージョン:
v 2.3
関連項目:
ServletRequest

コンストラクタの概要
ServletRequestWrapper(ServletRequest request)
          Creates a ServletRequest adaptor wrapping the given request object.
 
メソッドの概要
 java.lang.Object getAttribute(java.lang.String name)
          The default behavior of this method is to call getAttribute(String name) on the wrapped request object.
 java.util.Enumeration getAttributeNames()
          The default behavior of this method is to return getAttributeNames() on the wrapped request object.
 java.lang.String getCharacterEncoding()
          The default behavior of this method is to return getCharacterEncoding() on the wrapped request object.
 int getContentLength()
          The default behavior of this method is to return getContentLength() on the wrapped request object.
 java.lang.String getContentType()
          The default behavior of this method is to return getContentType() on the wrapped request object.
 ServletInputStream getInputStream()
          The default behavior of this method is to return getInputStream() on the wrapped request object.
 java.util.Locale getLocale()
          The default behavior of this method is to return getLocale() on the wrapped request object.
 java.util.Enumeration getLocales()
          The default behavior of this method is to return getLocales() on the wrapped request object.
 java.lang.String getParameter(java.lang.String name)
          The default behavior of this method is to return getParameter(String name) on the wrapped request object.
 java.util.Map getParameterMap()
          The default behavior of this method is to return getParameterMap() on the wrapped request object.
 java.util.Enumeration getParameterNames()
          The default behavior of this method is to return getParameterNames() on the wrapped request object.
 java.lang.String[] getParameterValues(java.lang.String name)
          The default behavior of this method is to return getParameterValues(String name) on the wrapped request object.
 java.lang.String getProtocol()
          The default behavior of this method is to return getProtocol() on the wrapped request object.
 java.io.BufferedReader getReader()
          The default behavior of this method is to return getReader() on the wrapped request object.
 java.lang.String getRealPath(java.lang.String path)
          The default behavior of this method is to return getRealPath(String path) on the wrapped request object.
 java.lang.String getRemoteAddr()
          The default behavior of this method is to return getRemoteAddr() on the wrapped request object.
 java.lang.String getRemoteHost()
          The default behavior of this method is to return getRemoteHost() on the wrapped request object.
 ServletRequest getRequest()
          Return the wrapped request object.
 RequestDispatcher getRequestDispatcher(java.lang.String path)
          The default behavior of this method is to return getRequestDispatcher(String path) on the wrapped request object.
 java.lang.String getScheme()
          The default behavior of this method is to return getScheme() on the wrapped request object.
 java.lang.String getServerName()
          The default behavior of this method is to return getServerName() on the wrapped request object.
 int getServerPort()
          The default behavior of this method is to return getServerPort() on the wrapped request object.
 boolean isSecure()
          The default behavior of this method is to return isSecure() on the wrapped request object.
 void removeAttribute(java.lang.String name)
          The default behavior of this method is to call removeAttribute(String name) on the wrapped request object.
 void setAttribute(java.lang.String name, java.lang.Object o)
          The default behavior of this method is to return setAttribute(String name, Object o) on the wrapped request object.
 void setCharacterEncoding(java.lang.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.
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

ServletRequestWrapper

public ServletRequestWrapper(ServletRequest request)
Creates a ServletRequest adaptor wrapping the given request object.

例外:
java.lang.IllegalArgumentException - if the request is null
メソッドの詳細

getRequest

public ServletRequest getRequest()
Return the wrapped request object.


setRequest

public void setRequest(ServletRequest request)
Sets the request object being wrapped.

例外:
java.lang.IllegalArgumentException - if the request is null.

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
The default behavior of this method is to call getAttribute(String name) on the wrapped request object.

定義:
インタフェース ServletRequest 内の getAttribute
パラメータ:
name - a String specifying the name of the attribute
戻り値:
an Object containing the value of the attribute, or null if the attribute does not exist

getAttributeNames

public java.util.Enumeration getAttributeNames()
The default behavior of this method is to return getAttributeNames() on the wrapped request object.

定義:
インタフェース ServletRequest 内の getAttributeNames
戻り値:
an Enumeration of strings containing the names of the request's attributes

getCharacterEncoding

public java.lang.String getCharacterEncoding()
The default behavior of this method is to return getCharacterEncoding() on the wrapped request object.

定義:
インタフェース ServletRequest 内の getCharacterEncoding
戻り値:
a String containing the name of the chararacter encoding, or null if the request does not specify a character encoding

setCharacterEncoding

public void setCharacterEncoding(java.lang.String enc)
                          throws java.io.UnsupportedEncodingException
The default behavior of this method is to set the character encoding on the wrapped request object.

定義:
インタフェース ServletRequest 内の setCharacterEncoding
例外:
java.io.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.

定義:
インタフェース ServletRequest 内の getContentLength
戻り値:
an integer containing the length of the request body or -1 if the length is not known

getContentType

public java.lang.String getContentType()
The default behavior of this method is to return getContentType() on the wrapped request object.

定義:
インタフェース ServletRequest 内の getContentType
戻り値:
a String containing the name of the MIME type of the request, or null if the type is not known

getInputStream

public ServletInputStream getInputStream()
                                  throws java.io.IOException
The default behavior of this method is to return getInputStream() on the wrapped request object.

定義:
インタフェース ServletRequest 内の getInputStream
戻り値:
a ServletInputStream object containing the body of the request
例外:
java.io.IOException - if an input or output exception occurred

getParameter

public java.lang.String getParameter(java.lang.String name)
The default behavior of this method is to return getParameter(String name) on the wrapped request object.

定義:
インタフェース ServletRequest 内の getParameter
パラメータ:
name - a String specifying the name of the parameter
戻り値:
a String representing the single value of the parameter
関連項目:
ServletRequest.getParameterValues(java.lang.String)

getParameterMap

public java.util.Map getParameterMap()
The default behavior of this method is to return getParameterMap() on the wrapped request object.

定義:
インタフェース ServletRequest 内の getParameterMap
戻り値:
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.

getParameterNames

public java.util.Enumeration getParameterNames()
The default behavior of this method is to return getParameterNames() on the wrapped request object.

定義:
インタフェース ServletRequest 内の getParameterNames
戻り値:
an Enumeration of String objects, each String containing the name of a request parameter; or an empty Enumeration if the request has no parameters

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String name)
The default behavior of this method is to return getParameterValues(String name) on the wrapped request object.

定義:
インタフェース ServletRequest 内の getParameterValues
パラメータ:
name - a String containing the name of the parameter whose value is requested
戻り値:
an array of String objects containing the parameter's values
関連項目:
ServletRequest.getParameter(java.lang.String)

getProtocol

public java.lang.String getProtocol()
The default behavior of this method is to return getProtocol() on the wrapped request object.

定義:
インタフェース ServletRequest 内の getProtocol
戻り値:
a String containing the protocol name and version number

getScheme

public java.lang.String getScheme()
The default behavior of this method is to return getScheme() on the wrapped request object.

定義:
インタフェース ServletRequest 内の getScheme
戻り値:
a String containing the name of the scheme used to make this request

getServerName

public java.lang.String getServerName()
The default behavior of this method is to return getServerName() on the wrapped request object.

定義:
インタフェース ServletRequest 内の getServerName
戻り値:
a String containing the name of the server to which the request was sent

getServerPort

public int getServerPort()
The default behavior of this method is to return getServerPort() on the wrapped request object.

定義:
インタフェース ServletRequest 内の getServerPort
戻り値:
an integer specifying the port number

getReader

public java.io.BufferedReader getReader()
                                 throws java.io.IOException
The default behavior of this method is to return getReader() on the wrapped request object.

定義:
インタフェース ServletRequest 内の getReader
戻り値:
a BufferedReader containing the body of the request
例外:
java.io.IOException - if an input or output exception occurred
関連項目:
ServletRequest.getInputStream()

getRemoteAddr

public java.lang.String getRemoteAddr()
The default behavior of this method is to return getRemoteAddr() on the wrapped request object.

定義:
インタフェース ServletRequest 内の getRemoteAddr
戻り値:
a String containing the IP address of the client that sent the request

getRemoteHost

public java.lang.String getRemoteHost()
The default behavior of this method is to return getRemoteHost() on the wrapped request object.

定義:
インタフェース ServletRequest 内の getRemoteHost
戻り値:
a String containing the fully qualified name of the client

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object o)
The default behavior of this method is to return setAttribute(String name, Object o) on the wrapped request object.

定義:
インタフェース ServletRequest 内の setAttribute
パラメータ:
name - a String specifying the name of the attribute
o - the Object to be stored

removeAttribute

public void removeAttribute(java.lang.String name)
The default behavior of this method is to call removeAttribute(String name) on the wrapped request object.

定義:
インタフェース ServletRequest 内の removeAttribute
パラメータ:
name - a String specifying the name of the attribute to remove

getLocale

public java.util.Locale getLocale()
The default behavior of this method is to return getLocale() on the wrapped request object.

定義:
インタフェース ServletRequest 内の getLocale
戻り値:
the preferred Locale for the client

getLocales

public java.util.Enumeration getLocales()
The default behavior of this method is to return getLocales() on the wrapped request object.

定義:
インタフェース ServletRequest 内の getLocales
戻り値:
an Enumeration of preferred Locale objects for the client

isSecure

public boolean isSecure()
The default behavior of this method is to return isSecure() on the wrapped request object.

定義:
インタフェース ServletRequest 内の isSecure
戻り値:
a boolean indicating if the request was made using a secure channel

getRequestDispatcher

public RequestDispatcher getRequestDispatcher(java.lang.String path)
The default behavior of this method is to return getRequestDispatcher(String path) on the wrapped request object.

定義:
インタフェース ServletRequest 内の getRequestDispatcher
パラメータ:
path - a String specifying the pathname to the resource
戻り値:
a RequestDispatcher object that acts as a wrapper for the resource at the specified path
関連項目:
RequestDispatcher, ServletContext.getRequestDispatcher(java.lang.String)

getRealPath

public java.lang.String getRealPath(java.lang.String path)
The default behavior of this method is to return getRealPath(String path) on the wrapped request object.

定義:
インタフェース ServletRequest 内の getRealPath


Copyright © 1999-2002 The Apache Software Foundation. All Rights Reserved.