Top Description Inners Fields Constructors Methods
org.eclipse.jetty.ee10.servlet

public Class ServletApiRequest

extends Object
implements HttpServletRequest
Class Inheritance
All Implemented Interfaces
jakarta.servlet.http.HttpServletRequest, jakarta.servlet.ServletRequest
Known Direct Subclasses
org.eclipse.jetty.ee10.servlet.ServletApiRequest.AmbiguousURI
Imports
java.io.BufferedReader, .IOException, .InputStream, .InputStreamReader, .UnsupportedEncodingException, java.nio.charset.Charset, .IllegalCharsetNameException, .StandardCharsets, .UnsupportedCharsetException, java.security.Principal, java.util.AbstractList, .Collection, .Collections, .EnumSet, .Enumeration, .HashMap, .HashSet, .List, .Locale, .Map, .Set, java.util.concurrent.CompletableFuture, .ExecutionException, jakarta.servlet.AsyncContext, .DispatcherType, .RequestDispatcher, .ServletConnection, .ServletContext, .ServletException, .ServletInputStream, .ServletRequest, .ServletRequestAttributeEvent, .ServletRequestAttributeListener, .ServletResponse, jakarta.servlet.http.Cookie, .HttpServletMapping, .HttpServletRequest, .HttpServletResponse, .HttpSession, .HttpUpgradeHandler, .Part, .PushBuilder, org.eclipse.jetty.ee10.servlet.ServletContextHandler.ServletRequestInfo, org.eclipse.jetty.http.BadMessageException, .CookieCache, .CookieCompliance, .HttpCookie, .HttpException, .HttpField, .HttpFields, .HttpHeader, .HttpScheme, .HttpStatus, .HttpURI, .HttpVersion, .MimeTypes, .SetCookieParser, org.eclipse.jetty.io.QuietException, .RuntimeIOException, org.eclipse.jetty.security.AuthenticationState, .UserIdentity, org.eclipse.jetty.server.ConnectionMetaData, .FormFields, .HttpCookieUtils, .Request, .Response, .Session, org.eclipse.jetty.session.AbstractSessionManager, .ManagedSession, .SessionManager, org.eclipse.jetty.util.Callback, .Fields, .HostPort, .IO, .StringUtil, .URIUtil, org.slf4j.Logger, .LoggerFactory

The Jetty implementation of the ee10 HttpServletRequest object. This provides the bridge from Servlet HttpServletRequest to the Jetty Core Request via the ServletContextRequest.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
private static class
ServletApiRequest.ServletCookieList

Extended list of HttpCookies that converts and caches a servlet Cookie array.

Field Summary

Modifier and TypeField and Description
private AsyncContextState
private boolean
private Charset
private Fields
private boolean
private String
private int
private Fields
private ServletMultiPartFormData.Parts
private Fields
private BufferedReader
private Charset
private final ServletChannel
private final ServletContextRequest
private static final Logger

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public boolean
authenticate(HttpServletResponse
The HttpServletResponse associated with this HttpServletRequest
response
)

Implements jakarta.servlet.http.HttpServletRequest.authenticate.

Use the container login mechanism configured for the ServletContext to authenticate the user making this request.
public String
changeSessionId()

Implements jakarta.servlet.http.HttpServletRequest.changeSessionId.

Change the session id of the current session associated with this request and return the new session id.
private void
private void
private String
private int
private String
public AsyncContext
getAsyncContext()

Implements jakarta.servlet.ServletRequest.getAsyncContext.

Gets the AsyncContext that was created or reinitialized by the most recent invocation of startAsync or startAsync(ServletRequest, ServletResponse) on this request.
public Object
getAttribute(String
a String specifying the name of the attribute
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>
getAttributeNames()

Implements jakarta.servlet.ServletRequest.getAttributeNames.

Returns an Enumeration containing the names of the attributes available to this request.
public AuthenticationState
public String
getAuthType()

Implements jakarta.servlet.http.HttpServletRequest.getAuthType.

Returns the name of the authentication scheme used to protect the servlet.
public String
getCharacterEncoding()

Implements jakarta.servlet.ServletRequest.getCharacterEncoding.

Returns the name of the character encoding used in the body of this request.
public int
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 or is greater than Integer.MAX_VALUE.
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
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 String
getContextPath()

Implements jakarta.servlet.http.HttpServletRequest.getContextPath.

Returns the portion of the request URI that indicates the context of the request.
public Cookie[]
getCookies()

Implements jakarta.servlet.http.HttpServletRequest.getCookies.

Returns an array containing all of the Cookie objects the client sent with this request.
public long
getDateHeader(String
a String specifying the name of the header
name
)

Implements jakarta.servlet.http.HttpServletRequest.getDateHeader.

Returns the value of the specified request header as a long value that represents a Date object.
public DispatcherType
getDispatcherType()

Implements jakarta.servlet.ServletRequest.getDispatcherType.

Gets the dispatcher type of this request.
public HttpFields
public String
getHeader(String
a String specifying the header name
name
)

Implements jakarta.servlet.http.HttpServletRequest.getHeader.

Returns the value of the specified request header as a String.
public Enumeration<String>
getHeaderNames()

Implements jakarta.servlet.http.HttpServletRequest.getHeaderNames.

Returns an enumeration of all the header names this request contains.
public Enumeration<String>
getHeaders(String
a String specifying the header name
name
)

Implements jakarta.servlet.http.HttpServletRequest.getHeaders.

Returns all the values of the specified request header as an Enumeration of String objects.
public HttpServletMapping
getHttpServletMapping()

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

Return the HttpServletMapping of the request.
public ServletInputStream
getInputStream()

Implements jakarta.servlet.ServletRequest.getInputStream.

Retrieves the body of the request as binary data using a ServletInputStream.
public int
getIntHeader(String
a String specifying the name of a request header
name
)

Implements jakarta.servlet.http.HttpServletRequest.getIntHeader.

Returns the value of the specified request header as an int.
public String
getLocalAddr()

Implements jakarta.servlet.ServletRequest.getLocalAddr.

Returns the Internet Protocol (IP) address representing the interface on which the request was received.
public Locale
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>
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
getLocalName()

Implements jakarta.servlet.ServletRequest.getLocalName.

Returns the fully qualified name of the address returned by getLocalAddr().
public int
getLocalPort()

Implements jakarta.servlet.ServletRequest.getLocalPort.

Returns the Internet Protocol (IP) port number representing the interface on which the request was received.
public String
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.
public String
getParameter(String
a String specifying the name of the 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[]>
getParameterMap()

Implements jakarta.servlet.ServletRequest.getParameterMap.

Returns a java.util.Map of the parameters of this request.
public Enumeration<String>
getParameterNames()

Implements jakarta.servlet.ServletRequest.getParameterNames.

Returns an Enumeration of String objects containing the names of the parameters contained in this request.
private Fields
public String[]
getParameterValues(String
a String containing the name of the parameter whose value is requested
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 requested Part
name
)

Implements jakarta.servlet.http.HttpServletRequest.getPart.

Gets the Part with the given name.
public Collection<Part>
getParts()

Implements jakarta.servlet.http.HttpServletRequest.getParts.

Gets all the Part components of this request, provided that it is of type multipart/form-data.
public String
getPathInfo()

Implements jakarta.servlet.http.HttpServletRequest.getPathInfo.

Returns any extra path information associated with the URL the client sent when it made this request.
public String
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
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
getQueryString()

Implements jakarta.servlet.http.HttpServletRequest.getQueryString.

Returns the query string that is contained in the request URL after the path.
public BufferedReader
getReader()

Implements jakarta.servlet.ServletRequest.getReader.

Retrieves the body of the request as character data using a BufferedReader.
public String
getRemoteAddr()

Implements jakarta.servlet.ServletRequest.getRemoteAddr.

Returns the Internet Protocol (IP) of the remote end of the connection on which the request was received.
public String
getRemoteHost()

Implements jakarta.servlet.ServletRequest.getRemoteHost.

Returns the fully qualified name of the address returned by getRemoteAddr().
public int
getRemotePort()

Implements jakarta.servlet.ServletRequest.getRemotePort.

Returns the Internet Protocol (IP) source port the remote end of the connection on which the request was received.
public String
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 Request

Returns:

The core Request associated with the servlet API request. This may differ from ServletContextRequest as wrapped by the ServletContextHandler as it may have been further wrapped before being passed to ServletChannel#associate(Request, Response, Callback).
getRequest
()

public RequestDispatcher
getRequestDispatcher(String
a String specifying the pathname to the resource. If it is relative, it must be relative against the current servlet.
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
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 String
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 String
getScheme()

Implements jakarta.servlet.ServletRequest.getScheme.

Returns the name of the scheme used to make this request, for example, http, https, or ftp.
public String
getServerName()

Implements jakarta.servlet.ServletRequest.getServerName.

Returns the host name of the server to which the request was sent.
public int
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
getServletContext()

Implements jakarta.servlet.ServletRequest.getServletContext.

Gets the servlet context to which this ServletRequest was last dispatched.
public String
getServletPath()

Implements jakarta.servlet.http.HttpServletRequest.getServletPath.

Returns the part of this request's URL that calls the servlet.
public ServletContextHandler.ServletRequestInfo
public HttpSession
getSession(boolean
true to create a new session for this request if necessary; false to return null if there's no current session
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 HttpSession
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 Map<String, String>
getTrailerFields()

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

Get the request trailer fields.
private AuthenticationState
public Principal
getUserPrincipal()

Implements jakarta.servlet.http.HttpServletRequest.getUserPrincipal.

Returns a java.security.Principal object containing the name of the current authenticated user.
public boolean
isAsyncStarted()

Implements jakarta.servlet.ServletRequest.isAsyncStarted.

Checks if this request has been put into asynchronous mode.
public boolean
isAsyncSupported()

Implements jakarta.servlet.ServletRequest.isAsyncSupported.

Checks if this request supports asynchronous operation.
public boolean
isRequestedSessionIdFromCookie()

Implements jakarta.servlet.http.HttpServletRequest.isRequestedSessionIdFromCookie.

Checks whether the requested session ID was conveyed to the server as an HTTP cookie.

public boolean
isRequestedSessionIdFromURL()

Implements jakarta.servlet.http.HttpServletRequest.isRequestedSessionIdFromURL.

Checks whether the requested session ID was conveyed to the server as part of the request URL.

public boolean
isRequestedSessionIdValid()

Implements jakarta.servlet.http.HttpServletRequest.isRequestedSessionIdValid.

Checks whether the requested session ID is still valid.
public boolean
isSecure()

Implements jakarta.servlet.ServletRequest.isSecure.

Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS.
public boolean
isUserInRole(String
a String specifying the name of the role
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 String value corresponding to the login identifier of the user.
username
,
String
The password String corresponding to the identified user.
password
)

Implements jakarta.servlet.http.HttpServletRequest.login.

Validate the provided username and password in the password validation realm used by the web container login mechanism configured for the ServletContext.
public void
logout()

Implements jakarta.servlet.http.HttpServletRequest.logout.

Establish null as the value returned when getUserPrincipal, getRemoteUser, and getAuthType is called on the request.
public PushBuilder
newPushBuilder()

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

Instantiates a new instance of PushBuilder for issuing server push responses from the current request.
public void
removeAttribute(String
a String specifying the name of the attribute to remove
name
)

Implements jakarta.servlet.ServletRequest.removeAttribute.

Removes an attribute from this request.
public void
setAsyncSupported(boolean asyncSupported)

public void
setAttribute(String
a String specifying the name of the attribute
name
,
Object
the Object to be stored
attribute
)

Implements jakarta.servlet.ServletRequest.setAttribute.

Stores an attribute in this request.
public void
setCharacterEncoding(String
String containing the name of the character encoding.
encoding
)

Implements jakarta.servlet.ServletRequest.setCharacterEncoding.

Overrides the name of the character encoding used in the body of this request.
public AsyncContext
startAsync()

Implements jakarta.servlet.ServletRequest.startAsync.

Puts this request into asynchronous mode, and initializes its AsyncContext with the original (unwrapped) ServletRequest and ServletResponse objects.
public AsyncContext
startAsync(ServletRequest
the ServletRequest used to initialize the AsyncContext
servletRequest
,
ServletResponse
the ServletResponse used to initialize the AsyncContext
servletResponse
)

Implements jakarta.servlet.ServletRequest.startAsync.

Puts this request into asynchronous mode, and initializes its AsyncContext with the given request and response objects.
public <T extends HttpUpgradeHandler> T
upgrade(Class<T>
The HttpUpgradeHandler class used for the upgrade.
handlerClass
)

Implements jakarta.servlet.http.HttpServletRequest.upgrade.

Creates an instance of HttpUpgradeHandler for a given class and uses it for the http protocol upgrade processing.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait