|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--javax.servlet.ServletRequestWrapper
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| Constructor Summary | |
ServletRequestWrapper(ServletRequest request)
Creates a ServletRequest adaptor wrapping the given request object. |
|
| Method Summary | |
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. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public ServletRequestWrapper(ServletRequest request)
| Method Detail |
public ServletRequest getRequest()
public void setRequest(ServletRequest request)
public java.lang.Object getAttribute(java.lang.String name)
name - a String specifying the name of
the attributeObject containing the value
of the attribute, or null if
the attribute does not existpublic java.util.Enumeration getAttributeNames()
Enumeration of strings
containing the names
of the request's attributespublic java.lang.String getCharacterEncoding()
String containing the name of
the chararacter encoding, or null
if the request does not specify a character encoding
public void setCharacterEncoding(java.lang.String enc)
throws java.io.UnsupportedEncodingException
a - String containing the name of
the chararacter encoding.public int getContentLength()
public java.lang.String getContentType()
String containing the name
of the MIME type of
the request, or null if the type is not known
public ServletInputStream getInputStream()
throws java.io.IOException
ServletInputStream object containing
the body of the requestServletRequest.getReader() method
has already been called for this requestpublic java.lang.String getParameter(java.lang.String name)
name - a String specifying the
name of the parameterString representing the
single value of the parameterServletRequest.getParameterValues(java.lang.String)public java.util.Map getParameterMap()
public java.util.Enumeration getParameterNames()
Enumeration of String
objects, each String containing
the name of a request parameter; or an
empty Enumeration if the
request has no parameterspublic java.lang.String[] getParameterValues(java.lang.String name)
name - a String containing the name of
the parameter whose value is requestedString objects
containing the parameter's valuesServletRequest.getParameter(java.lang.String)public java.lang.String getProtocol()
String containing the protocol
name and version numberpublic java.lang.String getScheme()
String containing the name
of the scheme used to make this requestpublic java.lang.String getServerName()
String containing the name
of the server to which the request was sentpublic int getServerPort()
public java.io.BufferedReader getReader()
throws java.io.IOException
BufferedReader
containing the body of the requestServletRequest.getInputStream() method
has been called on this requestServletRequest.getInputStream()public java.lang.String getRemoteAddr()
String containing the
IP address of the client that sent the requestpublic java.lang.String getRemoteHost()
String containing the fully
qualified name of the client
public void setAttribute(java.lang.String name,
java.lang.Object o)
name - a String specifying
the name of the attributeo - the Object to be storedpublic void removeAttribute(java.lang.String name)
name - a String specifying
the name of the attribute to removepublic java.util.Locale getLocale()
Locale for the clientpublic java.util.Enumeration getLocales()
Enumeration of preferred
Locale objects for the clientpublic boolean isSecure()
public RequestDispatcher getRequestDispatcher(java.lang.String path)
path - a String specifying the pathname
to the resourceRequestDispatcher object
that acts as a wrapper for the resource
at the specified pathRequestDispatcher,
ServletContext.getRequestDispatcher(java.lang.String)public java.lang.String getRealPath(java.lang.String path)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||