| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | authenticate(HttpServletResponse
The response)HttpServletResponse associated with this HttpServletRequestImplements jakarta. ServletContext to authenticate the user making this
request.
|
| public String | changeSessionId()
Implements jakarta. |
| public String | getAuthType()
Implements jakarta. |
| public String | getContextPath()
Implements jakarta. |
| public Cookie[] | getCookies()
Implements jakarta. Cookie objects the client sent with this request.
|
| public long | getDateHeader(String
a name)String specifying the name of the headerImplements jakarta. long value that represents a Date
object.
|
| public String | getHeader(String
a name)String specifying the header nameImplements jakarta. String.
|
| public Enumeration | getHeaderNames()
Implements jakarta. |
| public Enumeration | getHeaders(String
a name)String specifying the header nameImplements jakarta. Enumeration of String objects.
|
| public int | getIntHeader(String
a name)String specifying the name of a request headerImplements jakarta. int.
|
| public String | getMethod()
Implements jakarta. |
| public Part | getPart(String
the name of the requested name)PartImplements jakarta. Part with the given name.
|
| public Collection | getParts()
Implements jakarta. Part components of this request, provided that it is of type multipart/form-data.
|
| public String | getPathInfo()
Implements jakarta. |
| public String | getPathTranslated()
Implements jakarta. |
| public String | getQueryString()
Implements jakarta. |
| public String | getRemoteUser()
Implements jakarta. null if the
user has not been authenticated.
|
| public String | getRequestedSessionId()
Implements jakarta. |
| public String | getRequestURI()
Implements jakarta. |
| public StringBuffer | getRequestURL()
Implements jakarta. |
| public String | getServletPath()
Implements jakarta. |
| public HttpSession | getSession(boolean
true to create a new session for this request if necessary; false to return
null if there's no current sessionImplements jakarta. HttpSession associated with this request or, if there is no current session and
create is true, returns a new session.
|
| public HttpSession | getSession()
Implements jakarta. |
| public Principal | getUserPrincipal()
Implements jakarta. java.security.Principal object containing the name of the current authenticated user.
|
| public boolean | isRequestedSessionIdFromCookie()
Implements jakarta. Checks whether the requested session ID was conveyed to the server as an HTTP cookie. |
| public boolean | isRequestedSessionIdFromURL()
Implements jakarta. Checks whether the requested session ID was conveyed to the server as part of the request URL. |
| public boolean | isRequestedSessionIdValid()
Implements jakarta. |
| public boolean | isUserInRole(String
a role)String specifying the name of the roleImplements jakarta. |
| public void | login(String
The username, String String value corresponding to the login identifier of the user.The password password)String corresponding to the identified user.Implements jakarta. ServletContext.
|
| public void | logout()
Implements jakarta. null as the value returned when getUserPrincipal, getRemoteUser, and
getAuthType is called on the request.
|
| public <T extends HttpUpgradeHandler> T | upgrade(Class<T>
The handlerClass)HttpUpgradeHandler class used for the upgrade.Implements jakarta. HttpUpgradeHandler for a given class and uses it for the http protocol upgrade
processing.
|
| ServletRequestHttpWrapper | back to summary |
|---|---|
| public ServletRequestHttpWrapper(ServletRequest request) | |
| authenticate | back to summary |
|---|---|
| public boolean authenticate(HttpServletResponse response) throws IOException, ServletException Implements jakarta. Doc from jakarta. Use the container login mechanism configured for the
This method may modify and commit the argument
| |
| changeSessionId | back to summary |
|---|---|
| public String changeSessionId() Implements jakarta. Doc from jakarta. Change the session id of the current session associated with this request and return the new session id. | |
| getAuthType | back to summary |
|---|---|
| public String getAuthType() Implements jakarta. Doc from jakarta. Returns the name of the authentication scheme used to protect the servlet. All servlet containers support basic, form
and client certificate authentication, and may additionally support digest authentication. If the servlet is not
authenticated | |
| getContextPath | back to summary |
|---|---|
| public String getContextPath() Implements jakarta. Doc from jakarta. Returns the portion of the request URI that indicates the context of the request. The context path always comes first in a request URI. The path starts with a "/" character but does not end with a "/" character. For servlets in the default (root) context, this method returns "". The container does not decode this string.
It is possible that a servlet container may match a context by more than one context path. In such cases this method
will return the actual context path used by the request and it may differ from the path returned by the
| |
| getCookies | back to summary |
|---|---|
| public Cookie[] getCookies() Implements jakarta. Doc from jakarta. Returns an array containing all of the | |
| getDateHeader | back to summary |
|---|---|
| public long getDateHeader(String name) Implements jakarta. Doc from jakarta. Returns the value of the specified request header as a The date is returned as the number of milliseconds since January 1, 1970 GMT. The header name is case insensitive.
If the request did not have a header of the specified name, this method returns -1. If the header can't be converted
to a date, the method throws an | |
| getHeader | back to summary |
|---|---|
| public String getHeader(String name) Implements jakarta. Doc from jakarta. Returns the value of the specified request header as a | |
| getHeaderNames | back to summary |
|---|---|
| public Enumeration Implements jakarta. Doc from jakarta. Returns an enumeration of all the header names this request contains. If the request has no headers, this method returns an empty enumeration.
Some servlet containers do not allow servlets to access headers using this method, in which case this method returns
| |
| getHeaders | back to summary |
|---|---|
| public Enumeration Implements jakarta. Doc from jakarta. Returns all the values of the specified request header as an
Some headers, such as
If the request did not include any headers of the specified name, this method returns an empty
| |
| getIntHeader | back to summary |
|---|---|
| public int getIntHeader(String name) Implements jakarta. Doc from jakarta. Returns the value of the specified request header as an The header name is case insensitive. | |
| getMethod | back to summary |
|---|---|
| public String getMethod() Implements jakarta. Doc from jakarta. Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT. | |
| getPart | back to summary |
|---|---|
| public Part getPart(String name) throws IOException, ServletException Implements jakarta. Doc from jakarta. Gets the
| |
| getParts | back to summary |
|---|---|
| public Collection Implements jakarta. Doc from jakarta. Gets all the
If this request is of type
Any changes to the returned
| |
| getPathInfo | back to summary |
|---|---|
| public String getPathInfo() Implements jakarta. Doc from jakarta. Returns any extra path information associated with the URL the client sent when it made this request. The extra path information follows the servlet path but precedes the query string and will start with a "/" character.
This method returns
| |
| getPathTranslated | back to summary |
|---|---|
| public String getPathTranslated() Implements jakarta. Doc from jakarta. Returns any extra path information after the servlet name but before the query string, and translates it to a real path.
If the URL does not have any extra path information, this method returns | |
| getQueryString | back to summary |
|---|---|
| public String getQueryString() Implements jakarta. Doc from jakarta. Returns the query string that is contained in the request URL after the path. This method returns | |
| getRemoteUser | back to summary |
|---|---|
| public String getRemoteUser() Implements jakarta. Doc from jakarta. Returns the login of the user making this request, if the user has been authenticated, or | |
| getRequestedSessionId | back to summary |
|---|---|
| public String getRequestedSessionId() Implements jakarta. Doc from jakarta. Returns the session ID specified by the client. This may not be the same as the ID of the current valid session for
this request. If the client did not specify a session ID, this method returns | |
| getRequestURI | back to summary | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public String getRequestURI() Implements jakarta. Doc from jakarta. Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request. The web container does not decode this String. For example:
| ||||||||||||
| getRequestURL | back to summary |
|---|---|
| public StringBuffer getRequestURL() Implements jakarta. Doc from jakarta. Reconstructs the URL the client used to make the request. The returned URL contains a protocol, server name, port number, and server path, but it does not include query string parameters.
If this request has been forwarded using
Because this method returns a This method is useful for creating redirect messages and for reporting errors.
| |
| getServletPath | back to summary |
|---|---|
| public String getServletPath() Implements jakarta. Doc from jakarta. Returns the part of this request's URL that calls the servlet. This path starts with a "/" character and includes the path to the servlet, but does not include any extra path information or a query string. This method will return an empty string ("") if the servlet used to process this request was matched using the "/*" pattern.
| |
| getSession | back to summary |
|---|---|
| public HttpSession getSession(boolean create) Implements jakarta. Doc from jakarta. Returns the current
If To make sure the session is properly maintained, you must call this method before the response is committed. If the container is using cookies to maintain session integrity and is asked to create a new session when the response is committed, an IllegalStateException is thrown.
| |
| getSession | back to summary |
|---|---|
| public HttpSession getSession() Implements jakarta. Doc from jakarta. Returns the current session associated with this request, or if the request does not have a session, creates one.
| |
| getUserPrincipal | back to summary |
|---|---|
| public Principal getUserPrincipal() Implements jakarta. Doc from jakarta. Returns a | |
| isRequestedSessionIdFromCookie | back to summary |
|---|---|
| public boolean isRequestedSessionIdFromCookie() Implements jakarta. Doc from jakarta. Checks whether the requested session ID was conveyed to the server as an HTTP cookie.
| |
| isRequestedSessionIdFromURL | back to summary |
|---|---|
| public boolean isRequestedSessionIdFromURL() Implements jakarta. Doc from jakarta. Checks whether the requested session ID was conveyed to the server as part of the request URL.
| |
| isRequestedSessionIdValid | back to summary |
|---|---|
| public boolean isRequestedSessionIdValid() Implements jakarta. Doc from jakarta. Checks whether the requested session ID is still valid.
If the client did not specify any session ID, this method returns
| |
| isUserInRole | back to summary |
|---|---|
| public boolean isUserInRole(String role) Implements jakarta. Doc from jakarta. Returns a boolean indicating whether the authenticated user is included in the specified logical "role". Roles and
role membership can be defined using deployment descriptors. If the user has not been authenticated, the method
returns
The role name "*" should never be used as an argument in calling | |
| login | back to summary |
|---|---|
| public void login(String username, String password) throws ServletException Implements jakarta. Doc from jakarta. Validate the provided username and password in the password validation realm used by the web container login
mechanism configured for the
This method returns without throwing a
When this method returns without throwing an exception, it must have established non-null values as the values
returned by
| |
| logout | back to summary |
|---|---|
| public void logout() throws ServletException Implements jakarta. Doc from jakarta. Establish
| |
| upgrade | back to summary |
|---|---|
| public <T extends HttpUpgradeHandler> T upgrade(Class<T> handlerClass) throws IOException, ServletException Implements jakarta. Doc from jakarta. Creates an instance of
| |