|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This class extends the javax.servlet.http.HttpServletRequest.
Method Summary | |
void |
forward(java.lang.String path,
Response response)
Forwards the request to the specified path. |
java.lang.String |
getAbsolutePath(java.lang.String path)
Converts the given URI path to an absolute path. |
Application |
getApplication()
Returns the servlet context associated with the request. |
java.lang.String |
getApplicationPath()
Converts the given URI path to an absolute path, but relative to the servlet context. |
RequestURI |
getDispatchedURI()
Returns the dispatched RequestURI object. |
int |
getElapsedTime()
Returns total time in milliseconds elapsed while processing the request. |
Host |
getHost()
Returns the HTTP host associated with the request. |
java.lang.String |
getJavaEncoding()
Returns Java encoding to be used for decoding the request information. |
RequestURI |
getURI()
Returns the RequestURI representing the request. |
void |
include(java.lang.String path,
Response response)
Includes the content of the specified path to the current request. |
boolean |
isIncluded()
Checks whether or not the request is included. |
boolean |
isPersistentConnection()
Whether or not the HTTP connection is persistent. |
void |
setCharacterEncoding(java.lang.String enc)
Sets the character encoding of the request. |
void |
setPersistentConnection(boolean value)
Enables or disables the persistent connection. |
Methods inherited from interface javax.servlet.http.HttpServletRequest |
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole |
Methods inherited from interface javax.servlet.ServletRequest |
getAttribute, getAttributeNames, getContentLength, getContentType, getCharacterEncoding, getInputStream, getLocale, getLocales, getParameter, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRequestDispatcher, getServerName, getServerPort, getScheme, isSecure, removeAttribute, setAttribute |
Method Detail |
public Host getHost()
public Application getApplication()
public RequestURI getURI()
public RequestURI getDispatchedURI()
The dispatched URI differs from the original URI if the request is currently being forwarded to a different path, or another resource is currently being included to the request.
public int getElapsedTime()
public boolean isPersistentConnection()
The persistent connections (also known as keep-alive connections) allow to receive and send multiple requests and responses through a single TCP/IP connection.
public void setPersistentConnection(boolean value)
The persistent connections (also known as keep-alive connections) allow to receive and send multiple requests and responses through a single TCP/IP connection. By setting it to false you will cause the connection to be closed by the server after the response is sent to the client.
Note: The persistence status is maintained by the server internally, so the best you can do is to avoid using this method.
value
- true if the connection associated with the request should
stay persistentpublic java.lang.String getAbsolutePath(java.lang.String path)
It takes a path relative to the request's servlet path and converts it to an absolute path. For example, if a current request's servlet path is "/guestbook", the the absolute form of the "index.html" argument would be "/guestbook/index.html".
The path argument must not go beyond the current servlet context.
path
- the relative path
public java.lang.String getApplicationPath()
It takes an absolute path and converts it to a path relative to the current servlet context. For example, if the current servlet context is "/guestbook", the path argument "/guestbook/index.html" would be converted to "/index.html".
The path argument must not go beyond the current servlet context.
public java.lang.String getJavaEncoding()
This method first calls getCharacterEncoding of the current request, and
if it returns null, then it uses the default encoding specified via the HTTPParameters
object. The MIME encoding is then mapped to the Java encoding name and returned. If no Java
encoding can be found for the given MIME charset, the default ISO8859_1 encoding
is returned instead.
Java encoding is used to decode the x-www-form-urlencoded data, such as request URI, query string, data sent via HTTP POST method, etc.
public void setCharacterEncoding(java.lang.String enc)
It tells the server the character encoding used by the request. The character encoding should be set before calling any of the getParameter or getReader methods.
This method may be used if the browser does not send the encoding information via the Content-Type request header.
enc
- the MIME charsetpublic void forward(java.lang.String path, Response response) throws java.io.IOException, javax.servlet.ServletException
The path information of the current request is modified to reflect the new URI path.
The path argument must not go beyond the current servlet context.
path
- the path to which the request should be forwarded
java.io.IOException
javax.servlet.ServletException
public void include(java.lang.String path, Response response) throws java.io.IOException, javax.servlet.ServletException
The path information of the request is left unchanged, although the included path information can be obtained via the request attributes.
The path argument must not go beyond the current servlet context.
path
- the path of the included resource
java.io.IOException
javax.servlet.ServletException
public boolean isIncluded()
Returns true if another resource is currently being included to the request
via the include
method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |