Interface java.servlet.ServletRequest
All Packages Class Hierarchy This Package Previous Next Index
Interface java.servlet.ServletRequest
- public interface ServletRequest
- extends Object
This interface represents a servlet request.
-
getAuthType()
- Returns the authentication scheme of the request, or null if none.
-
getContentLength()
- Returns the size of the request entity data, or -1 if not known.
-
getContentType()
- Returns the Internet Media Type of the request entity data, or
null if not known.
-
getDateHeader(String, long)
- Returns the value of a date header field.
-
getHeader(String)
- Returns the value of a header field, or null if not known.
-
getHeader(int)
- Returns the value of the nth header field, or null if there are
fewer than n fields.
-
getHeaderName(int)
- Returns the name of the nth header field, or null if there are
fewer than n fields.
-
getInputStream()
- Returns an input stream for reading request data.
-
getIntHeader(String, int)
- Returns the value of an integer header field.
-
getMethod()
- Returns the method with which the request was made.
-
getPathInfo()
- Returns optional extra path information following the servlet path,
but immediately preceding the query string.
-
getPathTranslated()
- Returns extra path information translated to a real path.
-
getProtocol()
- Returns the protocol and version of the request as a string of the
form <protocol>/<major version>.<minor version>.
-
getQueryParameter(String)
- Returns the value of the specified query string parameter, or null
if not found.
-
getQueryParameters()
- Returns a hash table of query string parameter values.
-
getQueryString()
- Returns the query string part of the servlet URI, or null if none.
-
getRemoteAddr()
- Returns the IP address of the agent that sent the request.
-
getRemoteHost()
- Returns the fully qualified host name of the agent that sent the
request.
-
getRemoteUser()
- Returns the name of the user making this request, or null if not
known.
-
getRequestPath()
- Returns the part of the request URI that corresponds to the
servlet path plus the optional extra path information, if any
-
getRequestURI()
- Returns the request URI.
-
getServerName()
- Returns the host name of the server as used in the <host>
part of the request URI.
-
getServerPort()
- Returns the port number on which this request was received as
used in the <port> part of the request URI.
-
getServletPath()
- Returns the part of the request URI that refers to the servlet
being invoked.
getMethod
public abstract String getMethod()
- Returns the method with which the request was made. The returned
value can be "GET", "HEAD", "POST", or an extension method. Same
as the CGI variable REQUEST_METHOD.
getContentLength
public abstract int getContentLength()
- Returns the size of the request entity data, or -1 if not known.
Same as the CGI variable CONTENT_LENGTH.
getContentType
public abstract String getContentType()
- Returns the Internet Media Type of the request entity data, or
null if not known. Same as the CGI variable CONTENT_TYPE.
getRequestURI
public abstract String getRequestURI()
- Returns the request URI.
getRequestPath
public abstract String getRequestPath()
- Returns the part of the request URI that corresponds to the
servlet path plus the optional extra path information, if any
getServletPath
public abstract String getServletPath()
- Returns the part of the request URI that refers to the servlet
being invoked. Analogous to the CGI variable SCRIPT_NAME.
getPathInfo
public abstract String getPathInfo()
- Returns optional extra path information following the servlet path,
but immediately preceding the query string. Returns null if not
specified. Same as the CGI variable PATH_INFO.
getPathTranslated
public abstract String getPathTranslated()
- Returns extra path information translated to a real path. Returns
null if no extra path information specified. Same as the CGI variable
PATH_TRANSLATED.
getQueryString
public abstract String getQueryString()
- Returns the query string part of the servlet URI, or null if none.
Same as the CGI variable QUERY_STRING.
getQueryParameter
public abstract String getQueryParameter(String name)
- Returns the value of the specified query string parameter, or null
if not found.
- Parameters:
- name - the parameter name
getQueryParameters
public abstract Hashtable getQueryParameters()
- Returns a hash table of query string parameter values.
getProtocol
public abstract String getProtocol()
- Returns the protocol and version of the request as a string of the
form <protocol>/<major version>.<minor version>.
Same as the CGI variable SERVER_PROTOCOL.
getServerName
public abstract String getServerName()
- Returns the host name of the server as used in the <host>
part of the request URI. Same as the CGI variable SERVER_NAME.
getServerPort
public abstract int getServerPort()
- Returns the port number on which this request was received as
used in the <port> part of the request URI. Same as the
CGI variable SERVER_PORT.
getRemoteUser
public abstract String getRemoteUser()
- Returns the name of the user making this request, or null if not
known. Same as the CGI variable REMOTE_USER.
getRemoteAddr
public abstract String getRemoteAddr()
- Returns the IP address of the agent that sent the request.
Same as the CGI variable REMOTE_ADDR.
getRemoteHost
public abstract String getRemoteHost()
- Returns the fully qualified host name of the agent that sent the
request. Same as the CGI variable REMOTE_HOST.
getAuthType
public abstract String getAuthType()
- Returns the authentication scheme of the request, or null if none.
Same as the CGI variable AUTH_TYPE.
getHeader
public abstract String getHeader(String name)
- Returns the value of a header field, or null if not known.
Same as the information passed in the CGI variables HTTP_*.
- Parameters:
- name - the header field name
getIntHeader
public abstract int getIntHeader(String name,
int def)
- Returns the value of an integer header field.
- Parameters:
- name - the header field name
- def - the integer value to return if header not found or the
integer format is invalid
getDateHeader
public abstract long getDateHeader(String name,
long def)
- Returns the value of a date header field.
- Parameters:
- name - the header field name
- def - the date value to return if header not found or the
date format is invalid
getHeaderName
public abstract String getHeaderName(int n)
- Returns the name of the nth header field, or null if there are
fewer than n fields. This can be used to iterate through all
the headers in the message.
getHeader
public abstract String getHeader(int n)
- Returns the value of the nth header field, or null if there are
fewer than n fields. This can be used to iterate through all
the headers in the message.
getInputStream
public abstract ServletInputStream getInputStream()
- Returns an input stream for reading request data.
All Packages Class Hierarchy This Package Previous Next Index