Example usage for Java javax.servlet.http HttpServletRequest fields, constructors, methods, implement or subclass
The text is from its open source code.
String | BASIC_AUTH String identifier for Basic authentication. |
String | FORM_AUTH String identifier for Form authentication. |
String | CLIENT_CERT_AUTH String identifier for Client Certificate authentication. |
String | DIGEST_AUTH String identifier for Digest authentication. |
boolean | authenticate(HttpServletResponse response) Use the container login mechanism configured for the ServletContext to authenticate the user making this request. |
String | changeSessionId() Change the session id of the current session associated with this request and return the new session id. |
boolean | equals(Object obj) Indicates whether some other object is "equal to" this one. |
AsyncContext | getAsyncContext() Gets the AsyncContext that was created or reinitialized by the most recent invocation of #startAsync or #startAsync(ServletRequest,ServletResponse) on this request. |
Object | getAttribute(String name) Returns the value of the named attribute as an Object , or null if no attribute of the given name exists. |
Enumeration | getAttributeNames() Returns an Enumeration containing the names of the attributes available to this request. |
String | getAuthType() Returns the name of the authentication scheme used to protect the servlet. |
String | getCharacterEncoding() Returns the name of the character encoding used in the body of this request. |
Class> | getClass() Returns the runtime class of this Object . |
int | getContentLength() Returns the length, in bytes, of the request body and made available by the input stream, or -1 if the length is not known ir is greater than Integer.MAX_VALUE. |
long | getContentLengthLong() Returns the length, in bytes, of the request body and made available by the input stream, or -1 if the length is not known. |
String | getContentType() Returns the MIME type of the body of the request, or null if the type is not known. |
String | getContextPath() Returns the portion of the request URI that indicates the context of the request. |
Cookie[] | getCookies() Returns an array containing all of the Cookie objects the client sent with this request. |
long | getDateHeader(String name) Returns the value of the specified request header as a long value that represents a Date object. |
DispatcherType | getDispatcherType() Gets the dispatcher type of this request. |
String | getHeader(String name) Returns the value of the specified request header as a String . |
Enumeration | getHeaderNames() Returns an enumeration of all the header names this request contains. |
Enumeration | getHeaders(String name) Returns all the values of the specified request header as an Enumeration of String objects. |
HttpServletMapping | getHttpServletMapping() Return the HttpServletMapping by which the HttpServlet for this HttpServletRequest was invoked. |
ServletInputStream | getInputStream() Retrieves the body of the request as binary data using a ServletInputStream . |
int | getIntHeader(String name) Returns the value of the specified request header as an int . |
String | getLocalAddr() Returns the Internet Protocol (IP) address of the interface on which the request was received. |
Locale | getLocale() Returns the preferred Locale that the client will accept content in, based on the Accept-Language header. |
Enumeration | getLocales() Returns an Enumeration of Locale objects indicating, in decreasing order starting with the preferred locale, the locales that are acceptable to the client based on the Accept-Language header. |
String | getLocalName() Returns the host name of the Internet Protocol (IP) interface on which the request was received. |
int | getLocalPort() Returns the Internet Protocol (IP) port number of the interface on which the request was received. |
String | getMethod() Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT. |
String | getParameter(String name) Returns the value of a request parameter as a String , or null if the parameter does not exist. |
Map | getParameterMap() Returns a java.util.Map of the parameters of this request. |
Enumeration | getParameterNames() Returns an Enumeration of String objects containing the names of the parameters contained in this request. |
String[] | getParameterValues(String name) Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist. |
Part | getPart(String name) Gets the Part with the given name. |
Collection | getParts() Gets all the Part components of this request, provided that it is of type multipart/form-data . |
String | getPathInfo() Returns any extra path information associated with the URL the client sent when it made this request. |
String | getPathTranslated() Returns any extra path information after the servlet name but before the query string, and translates it to a real path. |
String | getProtocol() Returns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion, for example, HTTP/1.1. |
String | getQueryString() Returns the query string that is contained in the request URL after the path. |
BufferedReader | getReader() Retrieves the body of the request as character data using a BufferedReader . |
String | getRealPath(String path) |
String | getRemoteAddr() Returns the Internet Protocol (IP) address of the client or last proxy that sent the request. |
String | getRemoteHost() Returns the fully qualified name of the client or the last proxy that sent the request. |
int | getRemotePort() Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request. |
String | getRemoteUser() Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated. |
RequestDispatcher | getRequestDispatcher(String path) Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given path. |
String | getRequestedSessionId() Returns the session ID specified by the client. |
String | getRequestURI() 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. |
StringBuffer | getRequestURL() Reconstructs the URL the client used to make the request. |
String | getScheme() Returns the name of the scheme used to make this request, for example, http , https , or ftp . |
String | getServerName() Returns the host name of the server to which the request was sent. |
int | getServerPort() Returns the port number to which the request was sent. |
ServletContext | getServletContext() Gets the servlet context to which this ServletRequest was last dispatched. |
String | getServletPath() Returns the part of this request's URL that calls the servlet. |
HttpSession | getSession() Returns the current session associated with this request, or if the request does not have a session, creates one. |
HttpSession | getSession(boolean create) Returns the current HttpSession associated with this request or, if there is no current session and create is true, returns a new session. |
java.security.Principal | getUserPrincipal() Returns a java.security.Principal object containing the name of the current authenticated user. |
int | hashCode() Returns a hash code value for the object. |
boolean | isAsyncStarted() Checks if this request has been put into asynchronous mode. |
boolean | isAsyncSupported() Checks if this request supports asynchronous operation. |
boolean | isRequestedSessionIdFromCookie() Checks whether the requested session ID was conveyed to the server as an HTTP cookie. |
boolean | isRequestedSessionIdFromURL() Checks whether the requested session ID was conveyed to the server as part of the request URL. |
boolean | isRequestedSessionIdFromUrl() |
boolean | isRequestedSessionIdValid() Checks whether the requested session ID is still valid. |
boolean | isSecure() Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS. |
boolean | isUserInRole(String role) Returns a boolean indicating whether the authenticated user is included in the specified logical "role". |
void | login(String username, String password) Validate the provided username and password in the password validation realm used by the web container login mechanism configured for the ServletContext . |
void | logout() Establish null as the value returned when getUserPrincipal , getRemoteUser , and getAuthType is called on the request. |
void | removeAttribute(String name) Removes an attribute from this request. |
void | setAttribute(String name, Object o) Stores an attribute in this request. |
void | setCharacterEncoding(String env) Overrides the name of the character encoding used in the body of this request. |
AsyncContext | startAsync() Puts this request into asynchronous mode, and initializes its AsyncContext with the original (unwrapped) ServletRequest and ServletResponse objects. |
AsyncContext | startAsync(ServletRequest servletRequest, ServletResponse servletResponse) Puts this request into asynchronous mode, and initializes its AsyncContext with the given request and response objects. |
String | toString() Returns a string representation of the object. |
T | upgrade(Class Creates an instance of HttpUpgradeHandler for a given class and uses it for the http protocol upgrade processing. |