|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Whenever the server receives a request it creates a ServletRequest object, puts all the request information in it and passes this along with a ServletResponse object to the approriate servlet.
Method Summary | |
java.lang.Object |
getAttribute(java.lang.String name)
Gets a named attribute's value. |
int |
getContentLength()
Gets the size in bytes of the request |
java.lang.String |
getContentType()
Gets the mime type of the request |
java.lang.String |
getCharacterEncoding()
Gets the character encoding of the request data. |
ServletInputStream |
getInputStream()
Creates an inputstream for servlets to read client request data from. |
java.lang.String |
getParameter(java.lang.String name)
Deprecated. But undepricated in Servlet API 2.1! |
java.util.Enumeration |
getParameterNames()
Gets all parameter names. |
java.lang.String[] |
getParameterValues(java.lang.String name)
Gets an array of Strings containing all the request parameter's values whose name matches name . |
java.lang.String |
getProtocol()
Gets the protocol of the request as Proto/Major.Minor ("HTTP/1.1"). |
java.io.BufferedReader |
getReader()
Creates an BufferedReader for servlets to read client request data from. |
java.lang.String |
getRealPath(java.lang.String path)
Translates the given path to the real path on the servers filesystem, using the servers documentroot. |
java.lang.String |
getRemoteAddr()
Gets the ip address of the client that sent the request |
java.lang.String |
getRemoteHost()
Gets the hostname of the client that sent the request. |
java.lang.String |
getServerName()
Get the name of the server receiving the request |
int |
getServerPort()
Gets the portnumber the server reveiving the request is running on. |
java.lang.String |
getScheme()
Gets the scheme of the request as defined by RFC 1783 ("ftp", "http", "gopher", "news"). |
Method Detail |
public int getContentLength()
public java.lang.String getContentType()
public java.lang.String getProtocol()
public java.lang.String getScheme()
public java.lang.String getServerName()
public int getServerPort()
public java.lang.String getRemoteAddr()
public java.lang.String getRemoteHost()
public java.lang.String getRealPath(java.lang.String path)
path
- the path which requires translatingpublic ServletInputStream getInputStream() throws java.io.IOException
java.io.IOException
- if an i/o related error occuredjava.lang.IllegalStateException
- if getReader
was already
called on this request.getReader()
public java.lang.String getParameter(java.lang.String name)
getParameterValues
should be used.
If there are more than one values associated with the parameter this
method will only return the first value as return by
getParameterValues
is returned.
see javax.servlet.ServletRequest.getParameterValues()name
- the name of the parameter whose value we wantpublic java.lang.String[] getParameterValues(java.lang.String name)
name
.public java.util.Enumeration getParameterNames()
Note that the Servlet API 2.1 documentation says that this returns an empty Enumeration if the input stream is empty, but this is not mandated by the Servlet Spec.
public java.lang.Object getAttribute(java.lang.String name)
Note that the Servlet 2.1 API Documentation mentions some predefined attribute names, but the Servlet Spec does not mention them. I (MJW) am not sure if they are platform specific (JWS) or not.
public java.io.BufferedReader getReader() throws java.io.IOException
java.io.IOException
- if an i/o related error occuredjava.lang.IllegalStateException
- if getInputStream
was
already called on this request.getInputStream()
public java.lang.String getCharacterEncoding()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |