- java.lang.Object
-
- org.eclipse.jetty.server.Request
-
- All Implemented Interfaces:
jakarta.servlet.http.HttpServletRequest,jakarta.servlet.ServletRequest
public class Request extends java.lang.Object implements jakarta.servlet.http.HttpServletRequestJetty Request.Implements
HttpServletRequestfrom thejakarta.servlet.httppackage.The standard interface of mostly getters, is extended with setters so that the request is mutable by the handlers that it is passed to. This allows the request object to be as lightweight as possible and not actually implement any significant behavior. For example
- the
getContextPath()method will return null, until the request has been passed to aContextHandlerwhich matches thegetPathInfo()with a context path and callssetContext(Context,String)as a result. For some dispatch types (ie include and named dispatch) the context path may not reflect theServletContextset bysetContext(Context, String). - the HTTP session methods will all return null sessions until such time as a request has been passed to a
SessionHandlerwhich checks for session cookies and enables the ability to create new sessions. - The
getServletPath()method will return "" until the request has been passed to aorg.eclipse.jetty.servlet.ServletHandlerand the pathInfo matched against the servlet URL patterns andsetServletPathMapping(ServletPathMapping)called as a result.
A request instance is created for each connection accepted by the server and recycled for each HTTP request received via that connection. An effort is made to avoid reparsing headers and cookies that are likely to be the same for requests from the same connection.
Request instances are recycled, which combined with badly written asynchronous applications can result in calls on requests that have been reset. The code is written in a style to avoid NPE and ISE when such calls are made, as this has often proved generate exceptions that distraction from debugging such bad asynchronous applications. Instead, request methods attempt to not fail when called in an illegal state, so that hopefully the bad application will proceed to a major state event (eg calling AsyncContext.onComplete) which has better asynchronous guards, true atomic state and better failure behaviour that will assist in debugging.
The form content that a request can process is limited to protect from Denial of Service attacks. The size in bytes is limited by
ContextHandler.getMaxFormContentSize()or if there is no context then the "org.eclipse.jetty.server.Request.maxFormContentSize"Serverattribute. The number of parameters keys is limited byContextHandler.getMaxFormKeys()or if there is no context then the "org.eclipse.jetty.server.Request.maxFormKeys"Serverattribute.If IOExceptions or timeouts occur while reading form parameters, these are thrown as unchecked Exceptions: ether
RuntimeIOException,BadMessageExceptionorRuntimeExceptionas appropriate.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String__MULTIPART_CONFIG_ELEMENT
-
Constructor Summary
Constructors Constructor Description Request(HttpChannel channel, HttpInput input)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddEventListener(java.util.EventListener listener)booleanauthenticate(jakarta.servlet.http.HttpServletResponse response)java.lang.StringchangeSessionId()voidenterSession(jakarta.servlet.http.HttpSession s)Remember a session that this request has just entered.voidextractFormParameters(org.eclipse.jetty.util.MultiMap<java.lang.String> params)jakarta.servlet.AsyncContextgetAsyncContext()java.lang.ObjectgetAttribute(java.lang.String name)Get Request Attribute.java.util.Enumeration<java.lang.String>getAttributeNames()org.eclipse.jetty.util.AttributesgetAttributes()AuthenticationgetAuthentication()Get the authentication.java.lang.StringgetAuthType()static RequestgetBaseRequest(jakarta.servlet.ServletRequest request)Obtain the baseRequestinstance of aServletRequest, by coercion, unwrapping or special attribute.java.lang.StringgetCharacterEncoding()org.eclipse.jetty.http.ComplianceViolation.ListenergetComplianceViolationListener()intgetContentLength()longgetContentLengthLong()longgetContentRead()java.lang.StringgetContentType()ContextHandler.ContextgetContext()java.lang.StringgetContextPath()jakarta.servlet.http.Cookie[]getCookies()longgetDateHeader(java.lang.String name)jakarta.servlet.DispatcherTypegetDispatcherType()ContextHandler.ContextgetErrorContext()java.lang.StringgetHeader(java.lang.String name)java.util.Enumeration<java.lang.String>getHeaderNames()java.util.Enumeration<java.lang.String>getHeaders(java.lang.String name)HttpChannelgetHttpChannel()HttpChannelStategetHttpChannelState()org.eclipse.jetty.http.HttpFieldsgetHttpFields()HttpInputgetHttpInput()jakarta.servlet.http.HttpServletMappinggetHttpServletMapping()org.eclipse.jetty.http.HttpURIgetHttpURI()org.eclipse.jetty.http.HttpVersiongetHttpVersion()intgetInputState()jakarta.servlet.ServletInputStreamgetInputStream()intgetIntHeader(java.lang.String name)java.lang.StringgetLocalAddr()java.util.LocalegetLocale()java.util.Enumeration<java.util.Locale>getLocales()java.lang.StringgetLocalName()intgetLocalPort()org.eclipse.jetty.http.MetaData.RequestgetMetaData()java.lang.StringgetMethod()java.lang.StringgetOriginalURI()java.lang.StringgetParameter(java.lang.String name)java.util.Map<java.lang.String,java.lang.String[]>getParameterMap()java.util.Enumeration<java.lang.String>getParameterNames()java.lang.String[]getParameterValues(java.lang.String name)jakarta.servlet.http.PartgetPart(java.lang.String name)java.util.Collection<jakarta.servlet.http.Part>getParts()java.lang.StringgetPathInContext()Get the path in the context.java.lang.StringgetPathInfo()java.lang.StringgetPathTranslated()java.lang.StringgetProtocol()java.lang.StringgetQueryEncoding()org.eclipse.jetty.util.MultiMap<java.lang.String>getQueryParameters()java.lang.StringgetQueryString()java.io.BufferedReadergetReader()java.lang.StringgetRealPath(java.lang.String path)Deprecated.java.lang.StringgetRemoteAddr()java.lang.StringgetRemoteHost()java.net.InetSocketAddressgetRemoteInetSocketAddress()Access the underlying RemoteInetSocketAddressfor this request.intgetRemotePort()java.lang.StringgetRemoteUser()jakarta.servlet.RequestDispatchergetRequestDispatcher(java.lang.String path)java.lang.StringgetRequestedSessionId()java.lang.StringgetRequestURI()java.lang.StringBuffergetRequestURL()UserIdentitygetResolvedUserIdentity()ResponsegetResponse()java.lang.StringBuildergetRootURL()Reconstructs the URL the client used to make the request.java.lang.StringgetScheme()java.lang.StringgetServerName()intgetServerPort()jakarta.servlet.ServletContextgetServletContext()java.lang.StringgetServletName()java.lang.StringgetServletPath()ServletPathMappinggetServletPathMapping()jakarta.servlet.ServletResponsegetServletResponse()jakarta.servlet.http.HttpSessiongetSession()jakarta.servlet.http.HttpSessiongetSession(boolean create)jakarta.servlet.http.HttpSessiongetSession(SessionHandler sessionHandler)Find a session that this request has already entered for the given SessionHandlerSessionHandlergetSessionHandler()longgetTimeStamp()Get Request TimeStampjava.util.Map<java.lang.String,java.lang.String>getTrailerFields()org.eclipse.jetty.http.HttpFieldsgetTrailerHttpFields()UserIdentitygetUserIdentity()UserIdentity.ScopegetUserIdentityScope()java.security.PrincipalgetUserPrincipal()booleanhasMetaData()booleanisAsyncStarted()booleanisAsyncSupported()booleanisHandled()booleanisHead()booleanisPush()booleanisPushSupported()booleanisRequestedSessionIdFromCookie()booleanisRequestedSessionIdFromUrl()Deprecated.booleanisRequestedSessionIdFromURL()booleanisRequestedSessionIdValid()booleanisSecure()booleanisUserInRole(java.lang.String role)voidlogin(java.lang.String username, java.lang.String password)voidlogout()voidmergeQueryParameters(java.lang.String oldQuery, java.lang.String newQuery)jakarta.servlet.http.PushBuildernewPushBuilder()voidonCompleted()Called when the request is fully finished being handled.voidonResponseCommit()Called when a response is about to be committed, ie sent back to the clientprotected voidrecycle()voidremoveAttribute(java.lang.String name)voidremoveEventListener(java.util.EventListener listener)voidresetParameters()voidsetAsyncAttributes()voidsetAsyncSupported(boolean supported, java.lang.Object source)voidsetAttribute(java.lang.String name, java.lang.Object value)Set a request attribute.voidsetAttributes(org.eclipse.jetty.util.Attributes attributes)Set the attributes for the request.voidsetAuthentication(Authentication authentication)Set the authentication.voidsetCharacterEncoding(java.lang.String encoding)voidsetCharacterEncodingUnchecked(java.lang.String encoding)voidsetContentParameters(org.eclipse.jetty.util.MultiMap<java.lang.String> contentParameters)voidsetContentType(java.lang.String contentType)voidsetContext(ContextHandler.Context context, java.lang.String pathInContext)Set request context and path in the context.voidsetCookies(jakarta.servlet.http.Cookie[] cookies)voidsetDispatcherType(jakarta.servlet.DispatcherType type)voidsetHandled(boolean h)voidsetHttpFields(org.eclipse.jetty.http.HttpFields fields)voidsetHttpURI(org.eclipse.jetty.http.HttpURI uri)voidsetMetaData(org.eclipse.jetty.http.MetaData.Request request)voidsetMethod(java.lang.String method)voidsetQueryEncoding(java.lang.String queryEncoding)Set the character encoding used for the query string.voidsetQueryParameters(org.eclipse.jetty.util.MultiMap<java.lang.String> queryParameters)voidsetRemoteAddr(java.net.InetSocketAddress addr)voidsetRequestedSessionId(java.lang.String requestedSessionId)voidsetRequestedSessionIdFromCookie(boolean requestedSessionIdCookie)voidsetSecure(boolean secure)voidsetServletPathMapping(ServletPathMapping servletPathMapping)Set the servletPathMapping, the servletPath and the pathInfo.voidsetSession(jakarta.servlet.http.HttpSession session)voidsetSessionHandler(SessionHandler sessionHandler)voidsetTimeStamp(long ts)voidsetTrailerHttpFields(org.eclipse.jetty.http.HttpFields trailers)voidsetUserIdentityScope(UserIdentity.Scope scope)jakarta.servlet.AsyncContextstartAsync()jakarta.servlet.AsyncContextstartAsync(jakarta.servlet.ServletRequest servletRequest, jakarta.servlet.ServletResponse servletResponse)booleantakeNewContext()java.lang.StringtoString()static jakarta.servlet.http.HttpServletRequestunwrap(jakarta.servlet.ServletRequest servletRequest)<T extends jakarta.servlet.http.HttpUpgradeHandler>
Tupgrade(java.lang.Class<T> handlerClass)
-
-
-
Field Detail
-
__MULTIPART_CONFIG_ELEMENT
public static final java.lang.String __MULTIPART_CONFIG_ELEMENT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Request
public Request(HttpChannel channel, HttpInput input)
-
-
Method Detail
-
getBaseRequest
public static Request getBaseRequest(jakarta.servlet.ServletRequest request)
Obtain the baseRequestinstance of aServletRequest, by coercion, unwrapping or special attribute.- Parameters:
request- The request- Returns:
- the base
Requestinstance of aServletRequest.
-
getHttpFields
public org.eclipse.jetty.http.HttpFields getHttpFields()
-
setHttpFields
public void setHttpFields(org.eclipse.jetty.http.HttpFields fields)
-
getTrailerFields
public java.util.Map<java.lang.String,java.lang.String> getTrailerFields()
- Specified by:
getTrailerFieldsin interfacejakarta.servlet.http.HttpServletRequest
-
setTrailerHttpFields
public void setTrailerHttpFields(org.eclipse.jetty.http.HttpFields trailers)
-
getTrailerHttpFields
public org.eclipse.jetty.http.HttpFields getTrailerHttpFields()
-
getHttpInput
public HttpInput getHttpInput()
-
isPush
public boolean isPush()
-
isPushSupported
public boolean isPushSupported()
-
newPushBuilder
public jakarta.servlet.http.PushBuilder newPushBuilder()
- Specified by:
newPushBuilderin interfacejakarta.servlet.http.HttpServletRequest
-
addEventListener
public void addEventListener(java.util.EventListener listener)
-
enterSession
public void enterSession(jakarta.servlet.http.HttpSession s)
Remember a session that this request has just entered.- Parameters:
s- the session
-
extractFormParameters
public void extractFormParameters(org.eclipse.jetty.util.MultiMap<java.lang.String> params)
-
getAsyncContext
public jakarta.servlet.AsyncContext getAsyncContext()
- Specified by:
getAsyncContextin interfacejakarta.servlet.ServletRequest
-
getHttpChannelState
public HttpChannelState getHttpChannelState()
-
getComplianceViolationListener
public org.eclipse.jetty.http.ComplianceViolation.Listener getComplianceViolationListener()
-
getAttribute
public java.lang.Object getAttribute(java.lang.String name)
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:
getAttributein interfacejakarta.servlet.ServletRequest- See Also:
ServletRequest.getAttribute(java.lang.String)
-
getAttributeNames
public java.util.Enumeration<java.lang.String> getAttributeNames()
- Specified by:
getAttributeNamesin interfacejakarta.servlet.ServletRequest
-
getAttributes
public org.eclipse.jetty.util.Attributes getAttributes()
-
getAuthentication
public Authentication getAuthentication()
Get the authentication.- Returns:
- the authentication
-
getAuthType
public java.lang.String getAuthType()
- Specified by:
getAuthTypein interfacejakarta.servlet.http.HttpServletRequest
-
getCharacterEncoding
public java.lang.String getCharacterEncoding()
- Specified by:
getCharacterEncodingin interfacejakarta.servlet.ServletRequest
-
getHttpChannel
public HttpChannel getHttpChannel()
- Returns:
- Returns the connection.
-
getContentLength
public int getContentLength()
- Specified by:
getContentLengthin interfacejakarta.servlet.ServletRequest
-
getContentLengthLong
public long getContentLengthLong()
- Specified by:
getContentLengthLongin interfacejakarta.servlet.ServletRequest
-
getContentRead
public long getContentRead()
-
getContentType
public java.lang.String getContentType()
- Specified by:
getContentTypein interfacejakarta.servlet.ServletRequest
-
getContext
public ContextHandler.Context getContext()
- Returns:
- The current
contextused for this request, ornullifsetContext(org.eclipse.jetty.server.handler.ContextHandler.Context, java.lang.String)has not yet been called.
-
getErrorContext
public ContextHandler.Context getErrorContext()
- Returns:
- The current
contextused for this error handling for this request. If the request is asynchronous, then it is the context that called async. Otherwise it is the last non-null context passed to #setContext
-
getContextPath
public java.lang.String getContextPath()
- Specified by:
getContextPathin interfacejakarta.servlet.http.HttpServletRequest
-
getPathInContext
public java.lang.String getPathInContext()
Get the path in the context. 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. - See Also:
setContext(Context, String)
-
getCookies
public jakarta.servlet.http.Cookie[] getCookies()
- Specified by:
getCookiesin interfacejakarta.servlet.http.HttpServletRequest
-
getDateHeader
public long getDateHeader(java.lang.String name)
- Specified by:
getDateHeaderin interfacejakarta.servlet.http.HttpServletRequest
-
getDispatcherType
public jakarta.servlet.DispatcherType getDispatcherType()
- Specified by:
getDispatcherTypein interfacejakarta.servlet.ServletRequest
-
getHeader
public java.lang.String getHeader(java.lang.String name)
- Specified by:
getHeaderin interfacejakarta.servlet.http.HttpServletRequest
-
getHeaderNames
public java.util.Enumeration<java.lang.String> getHeaderNames()
- Specified by:
getHeaderNamesin interfacejakarta.servlet.http.HttpServletRequest
-
getHeaders
public java.util.Enumeration<java.lang.String> getHeaders(java.lang.String name)
- Specified by:
getHeadersin interfacejakarta.servlet.http.HttpServletRequest
-
getInputState
public int getInputState()
- Returns:
- Returns the inputState.
-
getInputStream
public jakarta.servlet.ServletInputStream getInputStream() throws java.io.IOException- Specified by:
getInputStreamin interfacejakarta.servlet.ServletRequest- Throws:
java.io.IOException
-
getIntHeader
public int getIntHeader(java.lang.String name)
- Specified by:
getIntHeaderin interfacejakarta.servlet.http.HttpServletRequest
-
getLocale
public java.util.Locale getLocale()
- Specified by:
getLocalein interfacejakarta.servlet.ServletRequest
-
getLocales
public java.util.Enumeration<java.util.Locale> getLocales()
- Specified by:
getLocalesin interfacejakarta.servlet.ServletRequest
-
getLocalAddr
public java.lang.String getLocalAddr()
- Specified by:
getLocalAddrin interfacejakarta.servlet.ServletRequest
-
getLocalName
public java.lang.String getLocalName()
- Specified by:
getLocalNamein interfacejakarta.servlet.ServletRequest
-
getLocalPort
public int getLocalPort()
- Specified by:
getLocalPortin interfacejakarta.servlet.ServletRequest
-
getMethod
public java.lang.String getMethod()
- Specified by:
getMethodin interfacejakarta.servlet.http.HttpServletRequest
-
getParameter
public java.lang.String getParameter(java.lang.String name)
- Specified by:
getParameterin interfacejakarta.servlet.ServletRequest
-
getParameterMap
public java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()
- Specified by:
getParameterMapin interfacejakarta.servlet.ServletRequest
-
getParameterNames
public java.util.Enumeration<java.lang.String> getParameterNames()
- Specified by:
getParameterNamesin interfacejakarta.servlet.ServletRequest
-
getParameterValues
public java.lang.String[] getParameterValues(java.lang.String name)
- Specified by:
getParameterValuesin interfacejakarta.servlet.ServletRequest
-
getQueryParameters
public org.eclipse.jetty.util.MultiMap<java.lang.String> getQueryParameters()
-
setQueryParameters
public void setQueryParameters(org.eclipse.jetty.util.MultiMap<java.lang.String> queryParameters)
-
setContentParameters
public void setContentParameters(org.eclipse.jetty.util.MultiMap<java.lang.String> contentParameters)
-
resetParameters
public void resetParameters()
-
getPathInfo
public java.lang.String getPathInfo()
- Specified by:
getPathInfoin interfacejakarta.servlet.http.HttpServletRequest
-
getPathTranslated
public java.lang.String getPathTranslated()
- Specified by:
getPathTranslatedin interfacejakarta.servlet.http.HttpServletRequest
-
getProtocol
public java.lang.String getProtocol()
- Specified by:
getProtocolin interfacejakarta.servlet.ServletRequest
-
getHttpVersion
public org.eclipse.jetty.http.HttpVersion getHttpVersion()
-
getQueryEncoding
public java.lang.String getQueryEncoding()
-
getQueryString
public java.lang.String getQueryString()
- Specified by:
getQueryStringin interfacejakarta.servlet.http.HttpServletRequest
-
getReader
public java.io.BufferedReader getReader() throws java.io.IOException- Specified by:
getReaderin interfacejakarta.servlet.ServletRequest- Throws:
java.io.IOException
-
getRealPath
@Deprecated(since="Servlet API 2.1") public java.lang.String getRealPath(java.lang.String path)
Deprecated.- Specified by:
getRealPathin interfacejakarta.servlet.ServletRequest
-
getRemoteInetSocketAddress
public java.net.InetSocketAddress getRemoteInetSocketAddress()
Access the underlying RemoteInetSocketAddressfor this request.- Returns:
- the remote
InetSocketAddressfor this request, or null if the request has no remote (seeServletRequest.getRemoteAddr()for conditions that result in no remote address)
-
getRemoteAddr
public java.lang.String getRemoteAddr()
- Specified by:
getRemoteAddrin interfacejakarta.servlet.ServletRequest
-
getRemoteHost
public java.lang.String getRemoteHost()
- Specified by:
getRemoteHostin interfacejakarta.servlet.ServletRequest
-
getRemotePort
public int getRemotePort()
- Specified by:
getRemotePortin interfacejakarta.servlet.ServletRequest
-
getRemoteUser
public java.lang.String getRemoteUser()
- Specified by:
getRemoteUserin interfacejakarta.servlet.http.HttpServletRequest
-
getRequestDispatcher
public jakarta.servlet.RequestDispatcher getRequestDispatcher(java.lang.String path)
- Specified by:
getRequestDispatcherin interfacejakarta.servlet.ServletRequest
-
getRequestedSessionId
public java.lang.String getRequestedSessionId()
- Specified by:
getRequestedSessionIdin interfacejakarta.servlet.http.HttpServletRequest
-
getRequestURI
public java.lang.String getRequestURI()
- Specified by:
getRequestURIin interfacejakarta.servlet.http.HttpServletRequest
-
getRequestURL
public java.lang.StringBuffer getRequestURL()
- Specified by:
getRequestURLin interfacejakarta.servlet.http.HttpServletRequest
-
getResponse
public Response getResponse()
-
getRootURL
public java.lang.StringBuilder 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
public java.lang.String getScheme()
- Specified by:
getSchemein interfacejakarta.servlet.ServletRequest
-
getServerName
public java.lang.String getServerName()
- Specified by:
getServerNamein interfacejakarta.servlet.ServletRequest
-
getServerPort
public int getServerPort()
- Specified by:
getServerPortin interfacejakarta.servlet.ServletRequest
-
getServletContext
public jakarta.servlet.ServletContext getServletContext()
- Specified by:
getServletContextin interfacejakarta.servlet.ServletRequest
-
getServletName
public java.lang.String getServletName()
-
getServletPath
public java.lang.String getServletPath()
- Specified by:
getServletPathin interfacejakarta.servlet.http.HttpServletRequest
-
getServletResponse
public jakarta.servlet.ServletResponse getServletResponse()
-
changeSessionId
public java.lang.String changeSessionId()
- Specified by:
changeSessionIdin interfacejakarta.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.
-
onResponseCommit
public void onResponseCommit()
Called when a response is about to be committed, ie sent back to the client
-
getSession
public jakarta.servlet.http.HttpSession getSession(SessionHandler sessionHandler)
Find a session that this request has already entered for the given SessionHandler- Parameters:
sessionHandler- the SessionHandler (ie context) to check- Returns:
- the session for the passed session handler or null
-
getSession
public jakarta.servlet.http.HttpSession getSession()
- Specified by:
getSessionin interfacejakarta.servlet.http.HttpServletRequest
-
getSession
public jakarta.servlet.http.HttpSession getSession(boolean create)
- Specified by:
getSessionin interfacejakarta.servlet.http.HttpServletRequest
-
getSessionHandler
public SessionHandler getSessionHandler()
- Returns:
- Returns the sessionManager.
-
getTimeStamp
public long getTimeStamp()
Get Request TimeStamp- Returns:
- The time that the request was received.
-
getHttpURI
public org.eclipse.jetty.http.HttpURI getHttpURI()
-
setHttpURI
public void setHttpURI(org.eclipse.jetty.http.HttpURI uri)
-
getOriginalURI
public java.lang.String getOriginalURI()
- Returns:
- Returns the original uri passed in metadata before customization/rewrite
-
getUserIdentity
public UserIdentity getUserIdentity()
-
getResolvedUserIdentity
public UserIdentity getResolvedUserIdentity()
- Returns:
- The resolved user Identity, which may be null if the
Authenticationis notAuthentication.User(eg.Authentication.Deferred).
-
getUserIdentityScope
public UserIdentity.Scope getUserIdentityScope()
-
getUserPrincipal
public java.security.Principal getUserPrincipal()
- Specified by:
getUserPrincipalin interfacejakarta.servlet.http.HttpServletRequest
-
isHandled
public boolean isHandled()
-
isAsyncStarted
public boolean isAsyncStarted()
- Specified by:
isAsyncStartedin interfacejakarta.servlet.ServletRequest
-
isAsyncSupported
public boolean isAsyncSupported()
- Specified by:
isAsyncSupportedin interfacejakarta.servlet.ServletRequest
-
isRequestedSessionIdFromCookie
public boolean isRequestedSessionIdFromCookie()
- Specified by:
isRequestedSessionIdFromCookiein interfacejakarta.servlet.http.HttpServletRequest
-
isRequestedSessionIdFromUrl
@Deprecated(since="Servlet API 2.1") public boolean isRequestedSessionIdFromUrl()
Deprecated.- Specified by:
isRequestedSessionIdFromUrlin interfacejakarta.servlet.http.HttpServletRequest
-
isRequestedSessionIdFromURL
public boolean isRequestedSessionIdFromURL()
- Specified by:
isRequestedSessionIdFromURLin interfacejakarta.servlet.http.HttpServletRequest
-
isRequestedSessionIdValid
public boolean isRequestedSessionIdValid()
- Specified by:
isRequestedSessionIdValidin interfacejakarta.servlet.http.HttpServletRequest
-
isSecure
public boolean isSecure()
- Specified by:
isSecurein interfacejakarta.servlet.ServletRequest
-
setSecure
public void setSecure(boolean secure)
-
isUserInRole
public boolean isUserInRole(java.lang.String role)
- Specified by:
isUserInRolein interfacejakarta.servlet.http.HttpServletRequest
-
setMetaData
public void setMetaData(org.eclipse.jetty.http.MetaData.Request request)
- Parameters:
request- the Request metadata
-
getMetaData
public org.eclipse.jetty.http.MetaData.Request getMetaData()
-
hasMetaData
public boolean hasMetaData()
-
recycle
protected void recycle()
-
removeAttribute
public void removeAttribute(java.lang.String name)
- Specified by:
removeAttributein interfacejakarta.servlet.ServletRequest
-
removeEventListener
public void removeEventListener(java.util.EventListener listener)
-
setAsyncSupported
public void setAsyncSupported(boolean supported, java.lang.Object source)
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.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).- Specified by:
setAttributein interfacejakarta.servlet.ServletRequest- See Also:
ServletRequest.setAttribute(java.lang.String, java.lang.Object)
-
setAttributes
public void setAttributes(org.eclipse.jetty.util.Attributes attributes)
Set the attributes for the request.- Parameters:
attributes- The attributes, which must be aAttributes.Wrapperfor whichAttributes.unwrap(Attributes)will return the originalServletAttributes.
-
setAsyncAttributes
public void setAsyncAttributes()
-
setAuthentication
public void setAuthentication(Authentication authentication)
Set the authentication.- Parameters:
authentication- the authentication to set
-
setCharacterEncoding
public void setCharacterEncoding(java.lang.String encoding) throws java.io.UnsupportedEncodingException- Specified by:
setCharacterEncodingin interfacejakarta.servlet.ServletRequest- Throws:
java.io.UnsupportedEncodingException
-
setCharacterEncodingUnchecked
public void setCharacterEncodingUnchecked(java.lang.String encoding)
-
setContentType
public void setContentType(java.lang.String contentType)
-
setContext
public void setContext(ContextHandler.Context context, java.lang.String pathInContext)
Set request context and path in the context.- Parameters:
context- context objectpathInContext- the part of the URI path that is withing the context. For servlets, this is equal to servletPath + pathInfo
-
takeNewContext
public boolean takeNewContext()
- Returns:
- True if this is the first call of
takeNewContext()since the lastsetContext(org.eclipse.jetty.server.handler.ContextHandler.Context, String)call.
-
setCookies
public void setCookies(jakarta.servlet.http.Cookie[] cookies)
- Parameters:
cookies- The cookies to set.
-
setDispatcherType
public void setDispatcherType(jakarta.servlet.DispatcherType type)
-
setHandled
public void setHandled(boolean h)
-
setMethod
public void setMethod(java.lang.String method)
- Parameters:
method- The method to set.
-
isHead
public boolean isHead()
-
setQueryEncoding
public void setQueryEncoding(java.lang.String queryEncoding)
Set the character encoding used for the query string. This call will effect the return of getQueryString and getParamaters. 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
-
setRemoteAddr
public void setRemoteAddr(java.net.InetSocketAddress addr)
- Parameters:
addr- The address to set.
-
setRequestedSessionId
public void setRequestedSessionId(java.lang.String requestedSessionId)
- Parameters:
requestedSessionId- The requestedSessionId to set.
-
setRequestedSessionIdFromCookie
public void setRequestedSessionIdFromCookie(boolean requestedSessionIdCookie)
- Parameters:
requestedSessionIdCookie- The requestedSessionIdCookie to set.
-
setSession
public void setSession(jakarta.servlet.http.HttpSession session)
- Parameters:
session- The session to set.
-
setSessionHandler
public void setSessionHandler(SessionHandler sessionHandler)
- Parameters:
sessionHandler- The SessionHandler to set.
-
setTimeStamp
public void setTimeStamp(long ts)
-
setUserIdentityScope
public void setUserIdentityScope(UserIdentity.Scope scope)
-
startAsync
public jakarta.servlet.AsyncContext startAsync() throws java.lang.IllegalStateException- Specified by:
startAsyncin interfacejakarta.servlet.ServletRequest- Throws:
java.lang.IllegalStateException
-
startAsync
public jakarta.servlet.AsyncContext startAsync(jakarta.servlet.ServletRequest servletRequest, jakarta.servlet.ServletResponse servletResponse) throws java.lang.IllegalStateException- Specified by:
startAsyncin interfacejakarta.servlet.ServletRequest- Throws:
java.lang.IllegalStateException
-
unwrap
public static jakarta.servlet.http.HttpServletRequest unwrap(jakarta.servlet.ServletRequest servletRequest)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
authenticate
public boolean authenticate(jakarta.servlet.http.HttpServletResponse response) throws java.io.IOException, jakarta.servlet.ServletException- Specified by:
authenticatein interfacejakarta.servlet.http.HttpServletRequest- Throws:
java.io.IOExceptionjakarta.servlet.ServletException
-
getPart
public jakarta.servlet.http.Part getPart(java.lang.String name) throws java.io.IOException, jakarta.servlet.ServletException- Specified by:
getPartin interfacejakarta.servlet.http.HttpServletRequest- Throws:
java.io.IOExceptionjakarta.servlet.ServletException
-
getParts
public java.util.Collection<jakarta.servlet.http.Part> getParts() throws java.io.IOException, jakarta.servlet.ServletException- Specified by:
getPartsin interfacejakarta.servlet.http.HttpServletRequest- Throws:
java.io.IOExceptionjakarta.servlet.ServletException
-
login
public void login(java.lang.String username, java.lang.String password) throws jakarta.servlet.ServletException- Specified by:
loginin interfacejakarta.servlet.http.HttpServletRequest- Throws:
jakarta.servlet.ServletException
-
logout
public void logout() throws jakarta.servlet.ServletException- Specified by:
logoutin interfacejakarta.servlet.http.HttpServletRequest- Throws:
jakarta.servlet.ServletException
-
mergeQueryParameters
public void mergeQueryParameters(java.lang.String oldQuery, java.lang.String newQuery)
-
upgrade
public <T extends jakarta.servlet.http.HttpUpgradeHandler> T upgrade(java.lang.Class<T> handlerClass) throws java.io.IOException, jakarta.servlet.ServletException- Specified by:
upgradein interfacejakarta.servlet.http.HttpServletRequest- Throws:
java.io.IOExceptionjakarta.servlet.ServletException
-
setServletPathMapping
public void setServletPathMapping(ServletPathMapping servletPathMapping)
Set the servletPathMapping, the servletPath and the pathInfo.- Parameters:
servletPathMapping- The mapping used to return fromgetHttpServletMapping()
-
getServletPathMapping
public ServletPathMapping getServletPathMapping()
- Returns:
- The mapping for the current target servlet, regardless of dispatch type.
-
getHttpServletMapping
public jakarta.servlet.http.HttpServletMapping getHttpServletMapping()
- Specified by:
getHttpServletMappingin interfacejakarta.servlet.http.HttpServletRequest
-
-