Package org.eclipse.jetty.ee8.nested
Class Request
java.lang.Object
org.eclipse.jetty.ee8.nested.Request
- All Implemented Interfaces:
javax.servlet.http.HttpServletRequest
,javax.servlet.ServletRequest
Jetty Request.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Deprecated.static final String
The name of the MultiPartConfig request attributestatic final String
static final String
static final String
static final String
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEventListener
(EventListener listener) boolean
authenticate
(javax.servlet.http.HttpServletResponse response) void
extractFormParameters
(Fields params) javax.servlet.AsyncContext
getAttribute
(String name) Get Request Attribute.Get the authentication.static Request
getBaseRequest
(javax.servlet.ServletRequest request) Obtain the baseRequest
instance of aServletRequest
, by coercion, unwrapping or special attribute.long
Get the nanoTime at which the request arrived to a connector, obtained viaSystem.nanoTime()
.Deprecated, for removal: This API element is subject to removal in a future version.use core level ComplianceViolation.Listener instead. - will be removed in Jetty 12.1.0int
long
long
javax.servlet.http.Cookie[]
long
getDateHeader
(String name) javax.servlet.DispatcherType
getHeaders
(String name) javax.servlet.http.HttpServletMapping
int
javax.servlet.ServletInputStream
int
getIntHeader
(String name) int
getParameter
(String name) String[]
getParameterValues
(String name) javax.servlet.http.Part
Collection
<javax.servlet.http.Part> getParts()
Get the path relative to the context path, analogous togetServletPath()
+getPathInfo()
.Deprecated.getRealPath
(String path) Deprecated.Access the underlying RemoteInetSocketAddress
for this request.int
javax.servlet.RequestDispatcher
getRequestDispatcher
(String path) Reconstructs the URL the client used to make the request.int
javax.servlet.ServletContext
javax.servlet.ServletResponse
javax.servlet.http.HttpSession
javax.servlet.http.HttpSession
getSession
(boolean create) javax.servlet.http.HttpSession
getSession
(SessionManager sessionManager) Find a session that this request has already entered for the given SessionHandlerlong
Get Request TimeStampboolean
boolean
boolean
boolean
boolean
isHead()
boolean
isPush()
boolean
boolean
boolean
Deprecated.boolean
boolean
boolean
isSecure()
boolean
isUserInRole
(String role) void
void
logout()
void
mergeQueryParameters
(String oldQuery, String newQuery) javax.servlet.http.PushBuilder
void
Called when the request is fully finished being handled.protected void
recycle()
void
removeAttribute
(String name) void
removeEventListener
(EventListener listener) void
void
void
setAsyncSupported
(boolean supported, Object source) void
setAttribute
(String name, Object value) Set a request attribute. if the attribute name is "org.eclipse.jetty.server.server.Request.queryEncoding" then the value is also passed in a call tosetQueryEncoding(java.lang.String)
.void
setAttributes
(Attributes attributes) Set the attributes for the request.void
setAuthentication
(Authentication authentication) Set the authentication.void
setCharacterEncoding
(String encoding) void
setCharacterEncodingUnchecked
(String encoding) void
setContentFields
(Fields contentParameters) void
setContentParameters
(MultiMap<String> contentParameters) Deprecated.void
setContentType
(String contentType) void
setContext
(ContextHandler.APIContext context, String pathInContext) void
setDispatcherType
(javax.servlet.DispatcherType type) void
setHandled
(boolean h) void
setHttpFields
(HttpFields fields) void
setHttpURI
(HttpURI uri) void
void
setQueryEncoding
(String queryEncoding) Set the character encoding used for the query string.void
setQueryFields
(Fields queryParameters) void
setQueryParameters
(MultiMap<String> queryParameters) Deprecated.void
setSecure
(boolean secure) void
setServletPathMapping
(ServletPathMapping servletPathMapping) Set the servletPathMapping, the servletPath and the pathInfo.void
setTimeStamp
(long ts) void
setTrailerHttpFields
(HttpFields trailers) void
javax.servlet.AsyncContext
javax.servlet.AsyncContext
startAsync
(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse) toString()
static javax.servlet.http.HttpServletRequest
unwrap
(javax.servlet.ServletRequest servletRequest) <T extends javax.servlet.http.HttpUpgradeHandler>
TMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface javax.servlet.http.HttpServletRequest
isTrailerFieldsReady
-
Field Details
-
MULTIPART_CONFIG_ELEMENT
The name of the MultiPartConfig request attribute- See Also:
-
__MULTIPART_CONFIG_ELEMENT
Deprecated.- See Also:
-
SSL_CIPHER_SUITE
- See Also:
-
SSL_KEY_SIZE
- See Also:
-
SSL_SESSION_ID
- See Also:
-
PEER_CERTIFICATES
- See Also:
-
-
Constructor Details
-
Request
-
-
Method Details
-
getBaseRequest
Obtain the baseRequest
instance of aServletRequest
, by coercion, unwrapping or special attribute.- Parameters:
request
- The request- Returns:
- the base
Request
instance of aServletRequest
.
-
getHttpFields
-
setHttpFields
-
getTrailerFields
- Specified by:
getTrailerFields
in interfacejavax.servlet.http.HttpServletRequest
-
setTrailerHttpFields
-
getTrailerHttpFields
-
getHttpInput
-
isPush
public boolean isPush() -
isPushSupported
public boolean isPushSupported() -
newPushBuilder
public javax.servlet.http.PushBuilder newPushBuilder()- Specified by:
newPushBuilder
in interfacejavax.servlet.http.HttpServletRequest
-
addEventListener
-
extractFormParameters
-
getAsyncContext
public javax.servlet.AsyncContext getAsyncContext()- Specified by:
getAsyncContext
in interfacejavax.servlet.ServletRequest
-
getHttpChannelState
-
getComplianceViolationListener
@Deprecated(since="12.0.6", forRemoval=true) public ComplianceViolation.Listener getComplianceViolationListener()Deprecated, for removal: This API element is subject to removal in a future version.use core level ComplianceViolation.Listener instead. - will be removed in Jetty 12.1.0 -
getAttribute
Get Request Attribute.Also supports jetty specific attributes to gain access to Jetty APIs:
- org.eclipse.jetty.server.Server
- The Jetty Server instance
- org.eclipse.jetty.server.HttpChannel
- The HttpChannel for this request
- org.eclipse.jetty.server.HttpConnection
- The HttpConnection or null if another transport is used
- Specified by:
getAttribute
in interfacejavax.servlet.ServletRequest
- See Also:
-
getAttributeNames
- Specified by:
getAttributeNames
in interfacejavax.servlet.ServletRequest
-
getAttributes
-
getAuthentication
Get the authentication.- Returns:
- the authentication
-
getAuthType
- Specified by:
getAuthType
in interfacejavax.servlet.http.HttpServletRequest
-
getCharacterEncoding
- Specified by:
getCharacterEncoding
in interfacejavax.servlet.ServletRequest
-
getHttpChannel
- Returns:
- Returns the connection.
-
getContentLength
public int getContentLength()- Specified by:
getContentLength
in interfacejavax.servlet.ServletRequest
-
getContentLengthLong
public long getContentLengthLong()- Specified by:
getContentLengthLong
in interfacejavax.servlet.ServletRequest
-
getContentRead
public long getContentRead() -
getContentType
- Specified by:
getContentType
in interfacejavax.servlet.ServletRequest
-
getContext
- Returns:
- The
context
used for this request.
-
setContext
-
getLastContext
-
getLastPathInContext
-
getContextPath
- Specified by:
getContextPath
in interfacejavax.servlet.http.HttpServletRequest
-
getPathInContext
Get the path relative to the context path, analogous togetServletPath()
+getPathInfo()
. If no context is set, then the path in context is the full path.- Returns:
- The decoded part of the
getRequestURI()
path after anygetContextPath()
up to anygetQueryString()
, excluding path parameters.
-
getCookies
public javax.servlet.http.Cookie[] getCookies()- Specified by:
getCookies
in interfacejavax.servlet.http.HttpServletRequest
-
getDateHeader
- Specified by:
getDateHeader
in interfacejavax.servlet.http.HttpServletRequest
-
getDispatcherType
public javax.servlet.DispatcherType getDispatcherType()- Specified by:
getDispatcherType
in interfacejavax.servlet.ServletRequest
-
getHeader
- Specified by:
getHeader
in interfacejavax.servlet.http.HttpServletRequest
-
getHeaderNames
- Specified by:
getHeaderNames
in interfacejavax.servlet.http.HttpServletRequest
-
getHeaders
- Specified by:
getHeaders
in interfacejavax.servlet.http.HttpServletRequest
-
getInputState
public int getInputState()- Returns:
- Returns the inputState.
-
getInputStream
- Specified by:
getInputStream
in interfacejavax.servlet.ServletRequest
- Throws:
IOException
-
getIntHeader
- Specified by:
getIntHeader
in interfacejavax.servlet.http.HttpServletRequest
-
getLocale
- Specified by:
getLocale
in interfacejavax.servlet.ServletRequest
-
getLocales
- Specified by:
getLocales
in interfacejavax.servlet.ServletRequest
-
getLocalAddr
- Specified by:
getLocalAddr
in interfacejavax.servlet.ServletRequest
-
getLocalName
- Specified by:
getLocalName
in interfacejavax.servlet.ServletRequest
-
getLocalPort
public int getLocalPort()- Specified by:
getLocalPort
in interfacejavax.servlet.ServletRequest
-
getMethod
- Specified by:
getMethod
in interfacejavax.servlet.http.HttpServletRequest
-
getParameter
- Specified by:
getParameter
in interfacejavax.servlet.ServletRequest
-
getParameterMap
- Specified by:
getParameterMap
in interfacejavax.servlet.ServletRequest
-
getParameterNames
- Specified by:
getParameterNames
in interfacejavax.servlet.ServletRequest
-
getParameterValues
- Specified by:
getParameterValues
in interfacejavax.servlet.ServletRequest
-
getQueryParameters
Deprecated. -
getQueryFields
-
setQueryFields
-
setQueryParameters
Deprecated. -
setContentFields
-
setContentParameters
Deprecated. -
resetParameters
public void resetParameters() -
getPathInfo
- Specified by:
getPathInfo
in interfacejavax.servlet.http.HttpServletRequest
-
getPathTranslated
- Specified by:
getPathTranslated
in interfacejavax.servlet.http.HttpServletRequest
-
getProtocol
- Specified by:
getProtocol
in interfacejavax.servlet.ServletRequest
-
getHttpVersion
-
getQueryEncoding
-
getQueryString
- Specified by:
getQueryString
in interfacejavax.servlet.http.HttpServletRequest
-
getReader
- Specified by:
getReader
in interfacejavax.servlet.ServletRequest
- Throws:
IOException
-
getRealPath
Deprecated.- Specified by:
getRealPath
in interfacejavax.servlet.ServletRequest
-
getRemoteInetSocketAddress
Access the underlying RemoteInetSocketAddress
for this request.- Returns:
- the remote
InetSocketAddress
for this request, or null if the request has no remote (seeServletRequest.getRemoteAddr()
for conditions that result in no remote address)
-
getRemoteAddr
- Specified by:
getRemoteAddr
in interfacejavax.servlet.ServletRequest
-
getRemoteHost
- Specified by:
getRemoteHost
in interfacejavax.servlet.ServletRequest
-
getRemotePort
public int getRemotePort()- Specified by:
getRemotePort
in interfacejavax.servlet.ServletRequest
-
getRemoteUser
- Specified by:
getRemoteUser
in interfacejavax.servlet.http.HttpServletRequest
-
getRequestDispatcher
- Specified by:
getRequestDispatcher
in interfacejavax.servlet.ServletRequest
-
getRequestedSessionId
- Specified by:
getRequestedSessionId
in interfacejavax.servlet.http.HttpServletRequest
-
getRequestURI
- Specified by:
getRequestURI
in interfacejavax.servlet.http.HttpServletRequest
-
getRequestURL
- Specified by:
getRequestURL
in interfacejavax.servlet.http.HttpServletRequest
-
getResponse
-
getRootURL
Reconstructs the URL the client used to make the request. The returned URL contains a protocol, server name, port number, and, but it does not include a path.Because this method returns a
StringBuffer
, not a string, you can modify the URL easily, for example, to append path and query parameters.This method is useful for creating redirect messages and for reporting errors.
- Returns:
- "scheme://host:port"
-
getScheme
- Specified by:
getScheme
in interfacejavax.servlet.ServletRequest
-
getServerName
- Specified by:
getServerName
in interfacejavax.servlet.ServletRequest
-
getServerPort
public int getServerPort()- Specified by:
getServerPort
in interfacejavax.servlet.ServletRequest
-
getServletContext
public javax.servlet.ServletContext getServletContext()- Specified by:
getServletContext
in interfacejavax.servlet.ServletRequest
-
getServletName
-
getServletPath
- Specified by:
getServletPath
in interfacejavax.servlet.http.HttpServletRequest
-
getServletResponse
public javax.servlet.ServletResponse getServletResponse() -
changeSessionId
- Specified by:
changeSessionId
in interfacejavax.servlet.http.HttpServletRequest
-
onCompleted
public void onCompleted()Called when the request is fully finished being handled. For every session in any context that the session has accessed, ensure that the session is completed. -
getSession
Find a session that this request has already entered for the given SessionHandler- Parameters:
sessionManager
- the SessionHandler (ie context) to check- Returns:
- the session for the passed session handler or null
-
getSession
public javax.servlet.http.HttpSession getSession()- Specified by:
getSession
in interfacejavax.servlet.http.HttpServletRequest
-
getSession
public javax.servlet.http.HttpSession getSession(boolean create) - Specified by:
getSession
in interfacejavax.servlet.http.HttpServletRequest
-
getTimeStamp
public long getTimeStamp()Get Request TimeStamp- Returns:
- The time that the request was received.
-
getHttpURI
-
setHttpURI
-
getOriginalURI
- Returns:
- Returns the original uri passed in metadata before customization/rewrite
-
getUserIdentity
-
getResolvedUserIdentity
- Returns:
- The resolved user Identity, which may be null if the
Authentication
is notAuthentication.User
(eg.Authentication.Deferred
).
-
getUserIdentityScope
-
getUserPrincipal
- Specified by:
getUserPrincipal
in interfacejavax.servlet.http.HttpServletRequest
-
isHandled
public boolean isHandled() -
isAsyncStarted
public boolean isAsyncStarted()- Specified by:
isAsyncStarted
in interfacejavax.servlet.ServletRequest
-
isAsyncSupported
public boolean isAsyncSupported()- Specified by:
isAsyncSupported
in interfacejavax.servlet.ServletRequest
-
isRequestedSessionIdFromCookie
public boolean isRequestedSessionIdFromCookie()- Specified by:
isRequestedSessionIdFromCookie
in interfacejavax.servlet.http.HttpServletRequest
-
isRequestedSessionIdFromUrl
Deprecated.- Specified by:
isRequestedSessionIdFromUrl
in interfacejavax.servlet.http.HttpServletRequest
-
isRequestedSessionIdFromURL
public boolean isRequestedSessionIdFromURL()- Specified by:
isRequestedSessionIdFromURL
in interfacejavax.servlet.http.HttpServletRequest
-
isRequestedSessionIdValid
public boolean isRequestedSessionIdValid()- Specified by:
isRequestedSessionIdValid
in interfacejavax.servlet.http.HttpServletRequest
-
isSecure
public boolean isSecure()- Specified by:
isSecure
in interfacejavax.servlet.ServletRequest
-
setSecure
public void setSecure(boolean secure) -
getBeginNanoTime
public long getBeginNanoTime()Get the nanoTime at which the request arrived to a connector, obtained via
System.nanoTime()
. This method can be used when measuring latencies.- Returns:
- The nanoTime at which the request was received/created in nanoseconds
-
isUserInRole
- Specified by:
isUserInRole
in interfacejavax.servlet.http.HttpServletRequest
-
getCoreRequest
-
getMetaData
-
hasMetaData
public boolean hasMetaData() -
recycle
protected void recycle() -
removeAttribute
- Specified by:
removeAttribute
in interfacejavax.servlet.ServletRequest
-
removeEventListener
-
setAsyncSupported
-
setAttribute
Set a request attribute. if the attribute name is "org.eclipse.jetty.server.server.Request.queryEncoding" then the value is also passed in a call tosetQueryEncoding(java.lang.String)
.- Specified by:
setAttribute
in interfacejavax.servlet.ServletRequest
- See Also:
-
setAttributes
Set the attributes for the request.- Parameters:
attributes
- The attributes, which must be aAttributes.Wrapper
for whichAttributes.unwrap(Attributes)
will return the originalServletAttributes
.
-
setAsyncAttributes
public void setAsyncAttributes() -
setAuthentication
Set the authentication.- Parameters:
authentication
- the authentication to set
-
setCharacterEncoding
- Specified by:
setCharacterEncoding
in interfacejavax.servlet.ServletRequest
- Throws:
UnsupportedEncodingException
-
setCharacterEncodingUnchecked
-
setContentType
-
setDispatcherType
public void setDispatcherType(javax.servlet.DispatcherType type) -
setHandled
public void setHandled(boolean h) -
setMethod
- Parameters:
method
- The method to set.
-
isHead
public boolean isHead() -
setQueryEncoding
Set the character encoding used for the query string. This call will effect the return of getQueryString and getParameters. It must be called before any getParameter methods.The request attribute "org.eclipse.jetty.server.Request.queryEncoding" may be set as an alternate method of calling setQueryEncoding.
- Parameters:
queryEncoding
- the URI query character encoding
-
setTimeStamp
public void setTimeStamp(long ts) -
setUserIdentityScope
-
startAsync
- Specified by:
startAsync
in interfacejavax.servlet.ServletRequest
- Throws:
IllegalStateException
-
startAsync
public javax.servlet.AsyncContext startAsync(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse) throws IllegalStateException - Specified by:
startAsync
in interfacejavax.servlet.ServletRequest
- Throws:
IllegalStateException
-
unwrap
public static javax.servlet.http.HttpServletRequest unwrap(javax.servlet.ServletRequest servletRequest) -
toString
-
authenticate
public boolean authenticate(javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException - Specified by:
authenticate
in interfacejavax.servlet.http.HttpServletRequest
- Throws:
IOException
javax.servlet.ServletException
-
getPart
public javax.servlet.http.Part getPart(String name) throws IOException, javax.servlet.ServletException - Specified by:
getPart
in interfacejavax.servlet.http.HttpServletRequest
- Throws:
IOException
javax.servlet.ServletException
-
getParts
public Collection<javax.servlet.http.Part> getParts() throws IOException, javax.servlet.ServletException- Specified by:
getParts
in interfacejavax.servlet.http.HttpServletRequest
- Throws:
IOException
javax.servlet.ServletException
-
login
- Specified by:
login
in interfacejavax.servlet.http.HttpServletRequest
- Throws:
javax.servlet.ServletException
-
logout
public void logout() throws javax.servlet.ServletException- Specified by:
logout
in interfacejavax.servlet.http.HttpServletRequest
- Throws:
javax.servlet.ServletException
-
mergeQueryParameters
-
upgrade
public <T extends javax.servlet.http.HttpUpgradeHandler> T upgrade(Class<T> handlerClass) throws IOException, javax.servlet.ServletException - Specified by:
upgrade
in interfacejavax.servlet.http.HttpServletRequest
- Throws:
IOException
javax.servlet.ServletException
-
setServletPathMapping
Set the servletPathMapping, the servletPath and the pathInfo.- Parameters:
servletPathMapping
- The mapping used to return fromgetHttpServletMapping()
-
getServletPathMapping
- Returns:
- The mapping for the current target servlet, regardless of dispatch type.
-
getHttpServletMapping
public javax.servlet.http.HttpServletMapping getHttpServletMapping()- Specified by:
getHttpServletMapping
in interfacejavax.servlet.http.HttpServletRequest
-
MULTIPART_CONFIG_ELEMENT