Top Description Inners Fields Constructors Methods
org.apache.catalina.connector

public Class Request

extends Object
implements HttpServletRequest
Class Inheritance
All Implemented Interfaces
jakarta.servlet.http.HttpServletRequest, jakarta.servlet.ServletRequest
Imports
java.io.BufferedReader, .EOFException, .File, .IOException, .InputStream, .StringReader, .UnsupportedEncodingException, java.nio.charset.Charset, .StandardCharsets, java.security.Principal, java.util.ArrayList, .Collection, .Collections, .Enumeration, .HashMap, .HashSet, .List, .Locale, .Map, .Set, .TreeMap, java.util.concurrent.ConcurrentHashMap, java.util.concurrent.atomic.AtomicBoolean, javax.naming.NamingException, javax.security.auth.Subject, jakarta.servlet.AsyncContext, .DispatcherType, .FilterChain, .MultipartConfigElement, .RequestDispatcher, .ServletConnection, .ServletContext, .ServletException, .ServletInputStream, .ServletRequest, .ServletRequestAttributeEvent, .ServletRequestAttributeListener, .ServletResponse, .SessionTrackingMode, jakarta.servlet.http.Cookie, .HttpServletMapping, .HttpServletRequest, .HttpServletRequestWrapper, .HttpServletResponse, .HttpSession, .HttpUpgradeHandler, .Part, .PushBuilder, org.apache.catalina.Container, .Context, .Globals, .Host, .Manager, .Realm, .Session, .TomcatPrincipal, .Wrapper, org.apache.catalina.core.ApplicationFilterChain, .ApplicationMapping, .ApplicationPart, .ApplicationPushBuilder, .ApplicationSessionCookieConfig, .AsyncContextImpl, org.apache.catalina.mapper.MappingData, org.apache.catalina.util.ParameterMap, .RequestUtil, .TLSUtil, .URLEncoder, org.apache.coyote.ActionCode, .UpgradeToken, org.apache.coyote.http11.upgrade.InternalHttpUpgradeHandler, org.apache.juli.logging.Log, .LogFactory, org.apache.tomcat.InstanceManager, org.apache.tomcat.util.ExceptionUtils, org.apache.tomcat.util.buf.B2CConverter, .ByteChunk, .EncodedSolidusHandling, .MessageBytes, .StringUtils, .UDecoder, org.apache.tomcat.util.http.CookieProcessor, .FastHttpDateFormat, .Parameters, .Parameters.FailReason, .Rfc6265CookieProcessor, .ServerCookie, .ServerCookies, org.apache.tomcat.util.http.fileupload.FileItem, .FileUpload, org.apache.tomcat.util.http.fileupload.disk.DiskFileItemFactory, org.apache.tomcat.util.http.fileupload.impl.InvalidContentTypeException, .SizeException, org.apache.tomcat.util.http.fileupload.servlet.ServletRequestContext, org.apache.tomcat.util.http.parser.AcceptLanguage, .Upgrade, org.apache.tomcat.util.net.SSLSupport, org.apache.tomcat.util.res.StringManager, org.ietf.jgss.GSSCredential, .GSSException

Wrapper object for the Coyote request.
Authors
Remy Maucherat, Craig R. McClanahan

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static interface

Field Summary

Modifier and TypeField and Description
private final ApplicationMapping
private HttpServletRequest
private volatile AsyncContextImpl
asyncContext

AsyncContext

protected Boolean
private final Map<String, Object>
attributes

The attributes associated with this Request, keyed by attribute name.

protected String
authType

Authentication type.

protected static final int
CACHED_POST_LEN

Post data buffer.

protected final Connector
connector

Associated Catalina connector.

protected Cookie[]
cookies

The set of cookies associated with this Request.

protected boolean
cookiesConverted

Cookie parsed flag.

protected boolean
cookiesParsed

Cookie headers parsed flag.

protected Request
coyoteRequest

Coyote request.

protected static final Locale
defaultLocale

The default Locale if none are specified.

protected RequestFacade
facade

The facade associated with this request.

protected FilterChain
filterChain

Filter chain associated with the request.

private static final String
protected final InputBuffer
inputBuffer

The associated input buffer.

protected CoyoteInputStream
inputStream

ServletInputStream.

protected DispatcherType
internalDispatcherType

The current dispatcher type.

protected String
localAddr

Local address

protected final ArrayList<Locale>
locales

The preferred Locales associated with this Request.

protected boolean
localesParsed

Parse locales.

protected String
localName

Local address

protected int
localPort

Local port

private static final Log
protected final MappingData
mappingData

Mapping data.

private final transient HashMap<String, Object>
notes

Internal notes associated with this request by Catalina components and event listeners.

protected ParameterMap<String, String[]>
parameterMap

Hash map used in the getParametersMap method.

protected boolean
parametersParsed

Request parameters parsed flag.

protected Collection<Part>
parts

The parts, if any, uploaded with this request.

protected Exception
partsParseException

The exception thrown, if any when parsing the parts.

protected String
peerAddr

Connection peer address.

protected byte[]
protected CoyoteReader
reader

Reader.

protected String
remoteAddr

Remote address.

protected String
remoteHost

Remote host.

protected int
remotePort

Remote port

protected Object
requestDispatcherPath

The current request dispatcher path.

protected boolean
requestedSessionCookie

Was the requested session ID received in a cookie?

protected String
requestedSessionId

The requested session ID (if any) for this request.

protected boolean
requestedSessionSSL

Was the requested session ID obtained from the SSL session?

protected boolean
requestedSessionURL

Was the requested session ID received in a URL?

protected Response
response

The response with which this request is associated.

protected boolean
secure

Secure flag.

protected Session
session

The currently active session for this request.

protected static final StringManager
sm

The string manager for this package.

private static final Map<String, Request.SpecialAttributeAdapter>
protected boolean
sslAttributesParsed

Flag that indicates if SSL attributes have been parsed to improve performance for applications (usually frameworks) that make multiple calls to Request#getAttributeNames().

protected transient Subject
subject

The Subject associated with the current AccessControlContext

protected B2CConverter
URIConverter

URI byte to char converter.

protected Principal
userPrincipal

User principal.

protected boolean
usingInputStream

Using stream flag.

protected boolean
usingReader

Using reader flag.

Constructor Summary

AccessConstructor and Description
public
Request(Connector
The Connector with which this Request object will always be associated. In normal usage this must be non-null. In some test scenarios, it may be possible to use a null Connector without triggering an NPE.
connector
)

Create a new Request object associated with the given Connector.

Method Summary

Modifier and TypeMethod and Description
public void
addCookie(Cookie
The new cookie
cookie
)

Add a Cookie to the set of Cookies associated with this Request.

public void
addLocale(Locale
The new preferred Locale
locale
)

Add a Locale to the set of preferred Locales for this Request.

protected void
public boolean
authenticate(HttpServletResponse
The response to use to return any authentication challenge
response
)

Implements jakarta.servlet.http.HttpServletRequest.authenticate.

Triggers the same authentication process as would be triggered if the request is for a resource that is protected by a security constraint.

public void
changeSessionId(String
The session to change the session ID for
newSessionId
)

Change the ID of the session that this request is associated with.

public String
changeSessionId()

Implements jakarta.servlet.http.HttpServletRequest.changeSessionId.

Changes the session ID of the session associated with this request.

protected void
checkSwallowInput()

Check the configuration for aborted uploads and if configured to do so, disable the swallowing of any remaining input and close the connection once the response has been written.

public void
clearCookies()

Clear the collection of Cookies associated with this Request.

public void
clearLocales()

Clear the collection of Locales associated with this Request.

protected void
convertCookies()

Converts the parsed cookies (parsing the Cookie headers first if they have not been parsed) into Cookie objects.

public ServletInputStream

Returns:

the created input stream
createInputStream
()

Create and return a ServletInputStream to read the content associated with this Request.

protected Session
doGetSession(boolean create)

public void
finishRequest()

Perform whatever actions are required to flush and close the input stream or reader, in a single operation.

public AsyncContext
getAsyncContext()

Implements jakarta.servlet.ServletRequest.getAsyncContext.

Get the current AsyncContext.

public AsyncContextImpl
public Object

Returns:

the specified request attribute if it exists; otherwise, return null.
getAttribute
(String
Name of the request attribute to return
name
)

Implements jakarta.servlet.ServletRequest.getAttribute.

Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.

public Enumeration<String>

Returns:

the attribute names enumeration
getAttributeNames
()

Implements jakarta.servlet.ServletRequest.getAttributeNames.

Return the names of all request attributes for this Request, or an empty Enumeration if there are none.

public String
getAuthType()

Implements jakarta.servlet.http.HttpServletRequest.getAuthType.

Return the authentication type used for this Request.

public String

Returns:

the character encoding for this Request.
getCharacterEncoding
()

Implements jakarta.servlet.ServletRequest.getCharacterEncoding.

Returns the name of the character encoding used in the body of this request.

private Charset
public Connector

Returns:

the Connector through which this Request was received.
getConnector
()

public int

Returns:

the content length for this Request.
getContentLength
()

Implements jakarta.servlet.ServletRequest.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.

public long
getContentLengthLong()

Implements jakarta.servlet.ServletRequest.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.

public String

Returns:

the content type for this Request.
getContentType
()

Implements jakarta.servlet.ServletRequest.getContentType.

Returns the MIME type of the body of the request, or null if the type is not known.

public Context

Returns:

the Context mapped with the request
getContext
()

Return the Context within which this Request is being processed.

public String
getContextPath()

Implements jakarta.servlet.http.HttpServletRequest.getContextPath.

Return the portion of the request URI used to select the Context of the Request.

private CookieProcessor
public Cookie[]

Returns:

the array of cookies
getCookies
()

Implements jakarta.servlet.http.HttpServletRequest.getCookies.

Return the set of Cookies received with this Request.

public Request

Returns:

the Coyote request object
getCoyoteRequest
()

Get the Coyote request.

public long

Returns:

the date as a long
getDateHeader
(String
Name of the requested date header
name
)

Implements jakarta.servlet.http.HttpServletRequest.getDateHeader.

Return the value of the specified date header, if any; otherwise return -1.

public String

Returns:

the URL decoded request URI
getDecodedRequestURI
()

Get the decoded request URI.

public MessageBytes

Returns:

the URL decoded request URI
getDecodedRequestURIMB
()

Get the decoded request URI.

public boolean

Returns:

the value of the flag as set on the connector, or true if no connector is associated with this request
getDiscardFacades
()

Get the recycling strategy of the facade objects.

public DispatcherType
public FilterChain

Returns:

the associated filter chain
getFilterChain
()

Get filter chain associated with the request.

public String

Returns:

the header value
getHeader
(String
Name of the requested header
name
)

Implements jakarta.servlet.http.HttpServletRequest.getHeader.

Return the first value of the specified header, if any; otherwise, return null

public Enumeration<String>

Returns:

the names of all headers received with this request.
getHeaderNames
()

Implements jakarta.servlet.http.HttpServletRequest.getHeaderNames.

Returns an enumeration of all the header names this request contains.

public Enumeration<String>

Returns:

the enumeration with the header values
getHeaders
(String
Name of the requested header
name
)

Implements jakarta.servlet.http.HttpServletRequest.getHeaders.

Return all of the values of the specified header, if any; otherwise, return an empty enumeration.

public Host

Returns:

the Host within which this Request is being processed.
getHost
()

public HttpServletMapping
getHttpServletMapping()

Overrides default jakarta.servlet.http.HttpServletRequest.getHttpServletMapping.

Obtain the mapping information for this request.

public ServletInputStream

Returns:

the servlet input stream for this Request. The default implementation returns a servlet input stream created by createInputStream().
getInputStream
()

Implements jakarta.servlet.ServletRequest.getInputStream.

Retrieves the body of the request as binary data using a ServletInputStream.

public int

Returns:

the header value as an int
getIntHeader
(String
Name of the requested header
name
)

Implements jakarta.servlet.http.HttpServletRequest.getIntHeader.

Return the value of the specified header as an integer, or -1 if there is no such header for this request.

public String

Returns:

the Internet Protocol (IP) address of the interface on which the request was received.
getLocalAddr
()

Implements jakarta.servlet.ServletRequest.getLocalAddr.

Returns the Internet Protocol (IP) address of the interface on which the request was received.

public Locale

Returns:

the preferred Locale that the client will accept content in, based on the value for the first Accept-Language header that was encountered. If the request did not specify a preferred language, the server's default Locale is returned.
getLocale
()

Implements jakarta.servlet.ServletRequest.getLocale.

Returns the preferred Locale that the client will accept content in, based on the Accept-Language header.

public Enumeration<Locale>

Returns:

the set of preferred Locales that the client will accept content in, based on the values for any Accept-Language headers that were encountered. If the request did not specify a preferred language, the server's default Locale is returned.
getLocales
()

Implements jakarta.servlet.ServletRequest.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.

public String

Returns:

the host name of the Internet Protocol (IP) interface on which the request was received.
getLocalName
()

Implements jakarta.servlet.ServletRequest.getLocalName.

Returns the host name of the Internet Protocol (IP) interface on which the request was received.

public int

Returns:

the Internet Protocol (IP) port number of the interface on which the request was received.
getLocalPort
()

Implements jakarta.servlet.ServletRequest.getLocalPort.

Returns the Internet Protocol (IP) port number of the interface on which the request was received.

public MappingData

Returns:

mapping data.
getMappingData
()

public String

Returns:

the HTTP request method used in this Request.
getMethod
()

Implements jakarta.servlet.http.HttpServletRequest.getMethod.

Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.

private Set<String>
public Object

Returns:

the object bound with the specified name to the internal notes for this request, or null if no such binding exists.
getNote
(String
Name of the note to be returned
name
)

public String

Returns:

the value of the specified request parameter, if any; otherwise, return null. If there is more than one value defined, return only the first one.
getParameter
(String
Name of the desired request parameter
name
)

Implements jakarta.servlet.ServletRequest.getParameter.

Returns the value of a request parameter as a String, or null if the parameter does not exist.

public Map<String, String[]>

Returns:

A Map containing parameter names as keys and parameter values as map values.
getParameterMap
()

Implements jakarta.servlet.ServletRequest.getParameterMap.

Returns a Map of the parameters of this request.

public Enumeration<String>

Returns:

the names of all defined request parameters for this request.
getParameterNames
()

Implements jakarta.servlet.ServletRequest.getParameterNames.

Returns an Enumeration of String objects containing the names of the parameters contained in this request.

public String[]

Returns:

the defined values for the specified request parameter, if any; otherwise, return null.
getParameterValues
(String
Name of the desired request parameter
name
)

Implements jakarta.servlet.ServletRequest.getParameterValues.

Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.

public Part
getPart(String
The name of the Part to obtain
name
)

Implements jakarta.servlet.http.HttpServletRequest.getPart.

Gets the named Part or null if the Part does not exist.

public Collection<Part>
getParts()

Implements jakarta.servlet.http.HttpServletRequest.getParts.

Return a collection of all uploaded Parts.

public String

Returns:

the path information associated with this Request.
getPathInfo
()

Implements jakarta.servlet.http.HttpServletRequest.getPathInfo.

Returns any extra path information associated with the URL the client sent when it made this request.

protected String
public String

Returns:

the extra path information for this request, translated to a real path.
getPathTranslated
()

Implements jakarta.servlet.http.HttpServletRequest.getPathTranslated.

Returns any extra path information after the servlet name but before the query string, and translates it to a real path.

public String

Returns:

the connection peer IP address making this Request.
getPeerAddr
()

public Principal

Returns:

the principal that has been authenticated for this Request.
getPrincipal
()

public String

Returns:

the protocol and version used to make this Request.
getProtocol
()

Implements jakarta.servlet.ServletRequest.getProtocol.

Returns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion, for example, HTTP/1.1.

public String
getProtocolRequestId()

Implements jakarta.servlet.ServletRequest.getProtocolRequestId.

Obtain the request identifier for this request as defined by the protocol in use.

public String

Returns:

the query string associated with this request.
getQueryString
()

Implements jakarta.servlet.http.HttpServletRequest.getQueryString.

Returns the query string that is contained in the request URL after the path.

public BufferedReader

Returns:

a buffered reader for the request
getReader
()

Implements jakarta.servlet.ServletRequest.getReader.

Read the Reader wrapping the input stream for this Request.

public String

Returns:

the remote IP address making this Request.
getRemoteAddr
()

Implements jakarta.servlet.ServletRequest.getRemoteAddr.

Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.

public String

Returns:

the remote host name making this Request.
getRemoteHost
()

Implements jakarta.servlet.ServletRequest.getRemoteHost.

Returns the fully qualified name of the client or the last proxy that sent the request.

public int

Returns:

the Internet Protocol (IP) source port of the client or last proxy that sent the request.
getRemotePort
()

Implements jakarta.servlet.ServletRequest.getRemotePort.

Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.

public String

Returns:

the name of the remote user that has been authenticated for this Request.
getRemoteUser
()

Implements jakarta.servlet.http.HttpServletRequest.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.

public HttpServletRequest

Returns:

the ServletRequest for which this object is the facade. This method must be implemented by a subclass.
getRequest
()

public RequestDispatcher

Returns:

a RequestDispatcher that wraps the resource at the specified path, which may be interpreted as relative to the current request path.
getRequestDispatcher
(String
Path of the resource to be wrapped
path
)

Implements jakarta.servlet.ServletRequest.getRequestDispatcher.

Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given path.

public String

Returns:

the session identifier included in this request, if any.
getRequestedSessionId
()

Implements jakarta.servlet.http.HttpServletRequest.getRequestedSessionId.

Returns the session ID specified by the client.

public String
getRequestId()

Implements jakarta.servlet.ServletRequest.getRequestId.

Obtain a unique (within the lifetime of the Servlet container) identifier string for this request.

public MessageBytes

Returns:

the request path
getRequestPathMB
()

Get the request path.

public String

Returns:

the request URI for this request.
getRequestURI
()

Implements jakarta.servlet.http.HttpServletRequest.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.

public StringBuffer
getRequestURL()

Implements jakarta.servlet.http.HttpServletRequest.getRequestURL.

Reconstructs the URL the client used to make the request.

public Response

Returns:

the Response with which this Request is associated.
getResponse
()

public String

Returns:

the scheme used to make this Request.
getScheme
()

Implements jakarta.servlet.ServletRequest.getScheme.

Returns the name of the scheme used to make this request, for example, http, https, or ftp.

public ServerCookies

Returns:

the server cookies
getServerCookies
()

Return the server representation of the cookies associated with this request.

public String

Returns:

the server name responding to this Request.
getServerName
()

Implements jakarta.servlet.ServletRequest.getServerName.

Returns the host name of the server to which the request was sent.

public int

Returns:

the server port responding to this Request.
getServerPort
()

Implements jakarta.servlet.ServletRequest.getServerPort.

Returns the port number to which the request was sent.

public ServletConnection
getServletConnection()

Implements jakarta.servlet.ServletRequest.getServletConnection.

Obtain details of the network connection to the Servlet container that is being used by this request.

public ServletContext
public String

Returns:

the portion of the request URI used to select the servlet that will process this request.
getServletPath
()

Implements jakarta.servlet.http.HttpServletRequest.getServletPath.

Returns the part of this request's URL that calls the servlet.

public HttpSession

Returns:

the session associated with this Request, creating one if necessary.
getSession
()

Implements jakarta.servlet.http.HttpServletRequest.getSession.

Returns the current session associated with this request, or if the request does not have a session, creates one.

public HttpSession

Returns:

the session associated with this Request, creating one if necessary and requested.
getSession
(boolean
Create a new session if one does not exist
create
)

Implements jakarta.servlet.http.HttpServletRequest.getSession.

Returns the current HttpSession associated with this request or, if there is no current session and create is true, returns a new session.

public Session

Returns:

the session associated with this Request, creating one if necessary.
getSessionInternal
()

public Session

Returns:

the session associated with this Request, creating one if necessary and requested.
getSessionInternal
(boolean
Create a new session if one does not exist
create
)

public InputStream

Returns:

the input stream associated with this Request.
getStream
()

public Map<String, String>
getTrailerFields()

Overrides default jakarta.servlet.http.HttpServletRequest.getTrailerFields.

Obtain a Map of the trailer fields that is not backed by the request object.

private String
getUpgradeProtocolName(Class<? extends HttpUpgradeHandler> httpUpgradeHandlerClass)

protected B2CConverter

Returns:

the URI converter.
getURIConverter
()

public Principal

Returns:

the principal that has been authenticated for this Request.
getUserPrincipal
()

Implements jakarta.servlet.http.HttpServletRequest.getUserPrincipal.

Returns a java.security.Principal object containing the name of the current authenticated user.

public Wrapper

Returns:

the Wrapper within which this Request is being processed.
getWrapper
()

public boolean
public boolean
public boolean
public boolean
public boolean
public boolean

Returns:

true if an attempt has been made to read the request body and all of the request body has been read.
isFinished
()

public boolean

Returns:

true if we have parsed parameters
isParametersParsed
()

public boolean

Returns:

true if the session identifier included in this request came from a cookie.
isRequestedSessionIdFromCookie
()

Implements jakarta.servlet.http.HttpServletRequest.isRequestedSessionIdFromCookie.

Checks whether the requested session ID came in as a cookie.

public boolean

Returns:

true if the session identifier included in this request came from the request URI.
isRequestedSessionIdFromURL
()

Implements jakarta.servlet.http.HttpServletRequest.isRequestedSessionIdFromURL.

Checks whether the requested session ID came in as part of the request URL.

public boolean

Returns:

true if the session identifier included in this request identifies a valid session.
isRequestedSessionIdValid
()

Implements jakarta.servlet.http.HttpServletRequest.isRequestedSessionIdValid.

Checks whether the requested session ID is still valid.

public boolean

Returns:

true if this request was received on a secure connection.
isSecure
()

Implements jakarta.servlet.ServletRequest.isSecure.

Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS.

public boolean
isTrailerFieldsReady()

Overrides default jakarta.servlet.http.HttpServletRequest.isTrailerFieldsReady.

Are trailer fields ready to be read (there may still be no trailers to read).

public boolean

Returns:

true if the authenticated user principal possesses the specified role name.
isUserInRole
(String
Role name to be validated
role
)

Implements jakarta.servlet.http.HttpServletRequest.isUserInRole.

Returns a boolean indicating whether the authenticated user is included in the specified logical "role".

public void
login(String
The user name to authenticate
username
,
String
The password to use to authenticate the user
password
)

Implements jakarta.servlet.http.HttpServletRequest.login.

Authenticate the provided user name and password and then associated the authenticated user with the request.

public void
logout()

Implements jakarta.servlet.http.HttpServletRequest.logout.

Removes any authenticated user from the request.

public PushBuilder
newPushBuilder()

Overrides default jakarta.servlet.http.HttpServletRequest.newPushBuilder.

Obtain a builder for generating push requests.

public PushBuilder
private Subject
newSubject(final Principal principal)

private int
nextSlash(char[] uri, int startPos)

private void
notifyAttributeAssigned(String
Attribute name
name
,
Object
New attribute value
value
,
Object
Old attribute value
oldValue
)

Notify interested listeners that attribute has been assigned a value.

private void
notifyAttributeRemoved(String
Attribute name
name
,
Object
Attribute value
value
)

Notify interested listeners that attribute has been removed.

protected void
parseCookies()

Parse cookies.

protected void
parseLocales()

Parse request locales.

protected void
parseLocalesHeader(String
the header value
value
,
TreeMap<Double, ArrayList<Locale>>
the map that will hold the result
locales
)

Parse accept-language header value.

protected void
parseParameters()

Parse request parameters.

private void
parseParts(boolean explicit)

protected byte[]

Returns:

the post body as a bytes array
readChunkedPostBody
()

Read chunked post body.

protected int

Returns:

the bytes count that has been read
readPostBody
(byte[]
The bytes array in which the body will be read
body
,
int
The body length
len
)
Deprecated Unused. Will be removed in Tomcat 11.0.x onwards. Use readPostBodyFully(byte[], int)

Read post body into an array.

protected void
readPostBodyFully(byte[]
The bytes array in which the body will be read
body
,
int
The body length
len
)

Read post body into an array.

public void
recycle()

Release all object references, and initialize instance variables, in preparation for reuse of this object.

protected void
recycleCookieInfo(boolean recycleCoyote)

protected void
public void
removeAttribute(String
Name of the request attribute to remove
name
)

Implements jakarta.servlet.ServletRequest.removeAttribute.

Remove the specified request attribute if it exists.

public void
removeNote(String
Name of the note to be removed
name
)

Remove any object bound to the specified name in the internal notes for this request.

private String
public void
setAsyncSupported(boolean asyncSupported)

public void
setAttribute(String
Name of the request attribute to set
name
,
Object
The associated value
value
)

Implements jakarta.servlet.ServletRequest.setAttribute.

Set the specified request attribute to the specified value.

public void
setAuthType(String
The authentication type used
type
)

Set the authentication type used for this request, if any; otherwise set the type to null.

public void
setCharacterEncoding(String
The character encoding to be used
enc
)

Implements jakarta.servlet.ServletRequest.setCharacterEncoding.

Overrides the name of the character encoding used in the body of this request.

public void
setContentType(String
The content type
contentType
)

Set the content type for this Request.

public void
setCoyoteRequest(Request
The Coyote request
coyoteRequest
)

Set the Coyote request.

public void
setFilterChain(FilterChain
new filter chain
filterChain
)

Set filter chain associated with the request.

public void
setLocalPort(int
The server port
port
)

Set the port number of the server to process this request.

public void
setNote(String
Name to which the object should be bound
name
,
Object
Object to be bound to the specified name
value
)

Bind an object to a specified name in the internal notes associated with this request, replacing any existing binding for this name.

public void
setPathInfo(String
The path information
path
)

Set the path information for this Request.

public void
setRemoteAddr(String
The remote IP address
remoteAddr
)

Set the IP address of the remote client associated with this Request.

public void
setRemoteHost(String
The remote host name
remoteHost
)

Set the fully qualified name of the remote client associated with this Request.

public void
setRequest(HttpServletRequest
The wrapped request to pass to the application
applicationRequest
)

Set a wrapped HttpServletRequest to pass to the application.

public void
setRequestedSessionCookie(boolean
The new flag
flag
)

Set a flag indicating whether or not the requested session ID for this request came in through a cookie.

public void
setRequestedSessionId(String
The new session id
id
)

Set the requested session ID for this request.

public void
setRequestedSessionSSL(boolean
The new flag
flag
)

Set a flag indicating whether or not the requested session ID for this request came in through SSL.

public void
setRequestedSessionURL(boolean
The new flag
flag
)

Set a flag indicating whether or not the requested session ID for this request came in through a URL.

public void
setResponse(Response
The new associated response
response
)

Set the Response with which this Request is associated.

public void
setSecure(boolean
The new isSecure value
secure
)

Set the value to be returned by isSecure() for this Request.

public void
setServerPort(int
The server port
port
)

Set the port number of the server to process this request.

protected void
setURIConverter(B2CConverter
the new URI converter
URIConverter
)

Set the URI converter.

public void
setUserPrincipal(final Principal
The user Principal
principal
)

Set the Principal who has been authenticated for this Request.

public AsyncContext
public AsyncContext
startAsync(ServletRequest
The ServletRequest with which to initialise the asynchronous context
request
,
ServletResponse
The ServletResponse with which to initialise the asynchronous context
response
)

Implements jakarta.servlet.ServletRequest.startAsync.

protected String
public <T extends HttpUpgradeHandler> T
upgrade(Class<T>
The class that implements the upgrade handler
httpUpgradeHandlerClass
)

Implements jakarta.servlet.http.HttpServletRequest.upgrade.

Start the HTTP upgrade process and create and instance of the provided protocol handler class.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait