|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An HTTP servlet request. This interface gets data from the client
to the servlet for use in the HttpServlet.service
method. It allows the HTTP-protocol specified header information to
be accessed from the service
method. This interface is
implemented by network-service developers for use within servlets.
Method Summary | |
java.lang.String |
getAuthType()
Gets the authentication scheme of this request. |
Cookie[] |
getCookies()
Gets the array of cookies found in this request. |
long |
getDateHeader(java.lang.String name)
Gets the value of the requested date header field of this request. |
java.lang.String |
getHeader(java.lang.String name)
Gets the value of the requested header field of this request. |
java.util.Enumeration |
getHeaderNames()
Gets the header names for this request. |
int |
getIntHeader(java.lang.String name)
Gets the value of the specified integer header field of this request. |
java.lang.String |
getMethod()
Gets the HTTP method (for example, GET, POST, PUT) with which this request was made. |
java.lang.String |
getPathInfo()
Gets any optional extra path information following the servlet path of this request's URI, but immediately preceding its query string. |
java.lang.String |
getPathTranslated()
Gets any optional extra path information following the servlet path of this request's URI, but immediately preceding its query string, and translates it to a real path. |
java.lang.String |
getQueryString()
Gets any query string that is part of the HTTP request URI. |
java.lang.String |
getRemoteUser()
Gets the name of the user making this request. |
java.lang.String |
getRequestedSessionId()
Gets the session id specified with this request. |
java.lang.String |
getRequestURI()
Gets, from the first line of the HTTP request, the part of this request's URI that is to the left of any query string. |
java.lang.String |
getServletPath()
Gets the part of this request's URI that refers to the servlet being invoked. |
HttpSession |
getSession()
Gets the current valid session associated with this request, if create is false or, if necessary, creates a new session for the request. |
HttpSession |
getSession(boolean create)
Gets the current valid session associated with this request, if create is false or, if necessary, creates a new session for the request, if create is true. |
boolean |
isRequestedSessionIdFromCookie()
Checks whether the session id specified by this request came in as a cookie. |
boolean |
isRequestedSessionIdFromUrl()
Deprecated. use isRequestSessionIdFromURL() instead |
boolean |
isRequestedSessionIdFromURL()
Checks whether the session id specified by this request came in as part of the URL. |
boolean |
isRequestedSessionIdValid()
Checks whether this request is associated with a session that is valid in the current session context. |
Methods inherited from interface javax.servlet.ServletRequest |
getAttribute,
getAttributeNames,
getCharacterEncoding,
getContentLength,
getContentType,
getInputStream,
getParameter,
getParameterNames,
getParameterValues,
getProtocol,
getReader,
getRealPath,
getRemoteAddr,
getRemoteHost,
getScheme,
getServerName,
getServerPort,
setAttribute |
Method Detail |
public java.lang.String getAuthType()
public Cookie[] getCookies()
public long getDateHeader(java.lang.String name)
name
- the String containing the name of the requested
header fieldpublic java.lang.String getHeader(java.lang.String name)
name
- the String containing the name of the requested
header fieldpublic java.util.Enumeration getHeaderNames()
public int getIntHeader(java.lang.String name)
name
- the String containing the name of the requested
header fieldpublic java.lang.String getMethod()
public java.lang.String getPathInfo()
public java.lang.String getPathTranslated()
public java.lang.String getQueryString()
public java.lang.String getRemoteUser()
public java.lang.String getRequestedSessionId()
isRequestedSessionIdValid()
public java.lang.String getRequestURI()
First line of HTTP request Return from getRequestURI
POST /some/path.html HTTP/1.1 /some/path.html GET http://foo.bar/a.html HTTP/1.0 http://foo.bar/a.html HEAD /xyz?a=b HTTP/1.1 /xyz
To reconstruct a URL with a URL scheme and host, use the method javax.servlet.http.HttpUtils.getRequestURL, which returns a StringBuffer.
HttpUtils.getRequestURL(javax.servlet.http.HttpServletRequest)
public java.lang.String getServletPath()
public HttpSession getSession(boolean create)
Note: to ensure the session is properly maintained, the servlet developer must call this method (at least once) before any output is written to the response.
Additionally, application-writers need to be aware that newly
created sessions (that is, sessions for which
HttpSession.isNew
returns true) do not have any
application-specific state.
public HttpSession getSession()
public boolean isRequestedSessionIdValid()
getSession
method.getRequestedSessionId()
,
HttpSessionContext
,
getSession(boolean)
public boolean isRequestedSessionIdFromCookie()
getSession
method.)getSession(boolean)
public boolean isRequestedSessionIdFromURL()
getSession
method.)getSession(boolean)
public boolean isRequestedSessionIdFromUrl()
getSession
method.)getSession(boolean)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |