Class ServletContextRequest
java.lang.Object
org.eclipse.jetty.server.Request.Wrapper
org.eclipse.jetty.server.handler.ContextRequest
org.eclipse.jetty.ee11.servlet.ServletContextRequest
- All Implemented Interfaces:
 ServletContextHandler.ServletRequestInfo, Content.Source, Request, Request.ServeAs, Attributes, Invocable
public class ServletContextRequest
extends ContextRequest
implements ServletContextHandler.ServletRequestInfo, Request.ServeAs
A core request wrapper that carries the servlet related request state,
which may be used directly by the associated 
ServletApiRequest.
Non-servlet related state, is used indirectly via ServletChannel.getRequest()
which may be a wrapper of this request.
This class is single use only.
- 
Nested Class Summary
Nested classes/interfaces inherited from interface Attributes
Attributes.Layer, Attributes.Lazy, Attributes.Mapped, Attributes.SyntheticNested classes/interfaces inherited from interface Content.Source
Content.Source.FactoryNested classes/interfaces inherited from interface Invocable
Invocable.Callable, Invocable.InvocationType, Invocable.ReadyTask, Invocable.TaskNested classes/interfaces inherited from interface Request
Request.AttributesWrapper, Request.AuthenticationState, Request.Handler, Request.ServeAs, Request.Wrapper - 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface Attributes
NULLFields inherited from interface Invocable
__nonBlocking, NOOPFields inherited from interface Request
COOKIE_ATTRIBUTE, DEFAULT_LOCALES, LOG - 
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedServletContextRequest(ServletContextHandler.ServletContextApi servletContextApi, ServletChannel servletChannel, Request request, Response response, String decodedPathInContext, MatchedResource<ServletHandler.MappedServlet> matchedResource, SessionManager sessionManager)  - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddEventListener(EventListener listener) voidgetAttribute(String name) Get an attribute by name.Get the immutable set of attribute names.jakarta.servlet.http.HttpServletResponseList<jakarta.servlet.ServletRequestAttributeListener> static ServletContextRequestgetServletContextRequest(jakarta.servlet.ServletRequest request) getSession(boolean create) Get aSessionassociated with the request.getState()booleanisHead()protected ServletApiRequestprotected ServletContextResponsenewServletContextResponse(Response response) removeAttribute(String name) Remove an attributevoidremoveEventListener(EventListener listener) setAttribute(String name, Object value) Set an attributevoidsetManagedSession(ManagedSession managedSession) voidsetQueryEncoding(String queryEncoding) Set the character encoding used for the query string.voidsetRequestedSession(AbstractSessionManager.RequestedSession requestedSession) Wraps a request but changes the uri so that it can be served to a different target.Methods inherited from class ContextRequest
addFailureListener, addIdleTimeoutListener, demand, getContextMethods inherited from class Request.Wrapper
addHttpStreamWrapper, asAttributeMap, clearAttributes, consumeAvailable, fail, getBeginNanoTime, getComponents, getConnectionMetaData, getHeaders, getHeadersNanoTime, getHttpURI, getId, getLength, getMethod, getTunnelSupport, getWrapped, isSecure, push, read, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Attributes
asAttributeMap, clearAttributes, equals, hashCodeMethods inherited from interface Content.Source
fail, fail, getLength, rewindMethods inherited from interface Invocable
getInvocationTypeMethods inherited from interface Request
addFailureListener, addHttpStreamWrapper, addIdleTimeoutListener, consumeAvailable, demand, getBeginNanoTime, getComponents, getConnectionMetaData, getContext, getHeaders, getHeadersNanoTime, getHttpURI, getId, getMethod, getTunnelSupport, isSecure, push, readMethods inherited from interface ServletContextHandler.ServletRequestInfo
getRequest 
- 
Field Details
- 
MULTIPART_CONFIG_ELEMENT
- See Also:
 
 - 
SSL_CIPHER_SUITE
- See Also:
 
 - 
SSL_KEY_SIZE
- See Also:
 
 - 
SSL_SESSION_ID
- See Also:
 
 - 
PEER_CERTIFICATES
- See Also:
 
 
 - 
 - 
Constructor Details
- 
ServletContextRequest
protected ServletContextRequest(ServletContextHandler.ServletContextApi servletContextApi, ServletChannel servletChannel, Request request, Response response, String decodedPathInContext, MatchedResource<ServletHandler.MappedServlet> matchedResource, SessionManager sessionManager)  
 - 
 - 
Method Details
- 
getServletContextRequest
public static ServletContextRequest getServletContextRequest(jakarta.servlet.ServletRequest request)  - 
wrap
Description copied from interface:Request.ServeAsWraps a request but changes the uri so that it can be served to a different target.- Specified by:
 wrapin interfaceRequest.ServeAs- Parameters:
 request- the original request.uri- the uri of the new target.- Returns:
 - the request wrapped to the new target.
 
 - 
newServletApiRequest
 - 
newServletContextResponse
 - 
getServletContextHandler
- Specified by:
 getServletContextHandlerin interfaceServletContextHandler.ServletRequestInfo
 - 
getDecodedPathInContext
- Specified by:
 getDecodedPathInContextin interfaceServletContextHandler.ServletRequestInfo
 - 
getMatchedResource
- Specified by:
 getMatchedResourcein interfaceServletContextHandler.ServletRequestInfo
 - 
getTrailers
- Specified by:
 getTrailersin interfaceRequest- Overrides:
 getTrailersin classRequest.Wrapper- Returns:
 - the HTTP trailers of this 
Request, ornullif they are not present 
 - 
getState
- Specified by:
 getStatein interfaceServletContextHandler.ServletRequestInfo
 - 
getServletContextResponse
 - 
getServletContext
- Specified by:
 getServletContextin interfaceServletContextHandler.ServletRequestInfo
 - 
getHttpInput
- Specified by:
 getHttpInputin interfaceServletContextHandler.ServletRequestInfo
 - 
getHttpOutput
 - 
errorClose
public void errorClose() - 
isHead
public boolean isHead() - 
setQueryEncoding
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.
- Specified by:
 setQueryEncodingin interfaceServletContextHandler.ServletRequestInfo- Parameters:
 queryEncoding- the URI query character encoding
 - 
getQueryEncoding
- Specified by:
 getQueryEncodingin interfaceServletContextHandler.ServletRequestInfo
 - 
getAttribute
Description copied from interface:AttributesGet an attribute by name. Some attributes may be "hidden" attributes, in that they are only found by an explicit call togetAttribute(String)and they do not otherwise appear inAttributes.getAttributeNameSet()orAttributes.asAttributeMap().- Specified by:
 getAttributein interfaceAttributes- Overrides:
 getAttributein classRequest.Wrapper- Parameters:
 name- the attribute to get- Returns:
 - the value of the attribute, or 
nullif no such attribute exists 
 - 
removeAttribute
Description copied from interface:AttributesRemove an attribute- Specified by:
 removeAttributein interfaceAttributes- Overrides:
 removeAttributein classRequest.Wrapper- Parameters:
 name- the attribute to remove- Returns:
 - the value of the attribute if removed, else 
null 
 - 
setAttribute
Description copied from interface:AttributesSet an attribute- Specified by:
 setAttributein interfaceAttributes- Overrides:
 setAttributein classRequest.Wrapper- Parameters:
 name- the attribute to setvalue- the value to set. A null value is equivalent to removing the attribute.- Returns:
 - the previous value of the attribute if set, else 
null 
 - 
getAttributeNameSet
Description copied from interface:AttributesGet the immutable set of attribute names.- Specified by:
 getAttributeNameSetin interfaceAttributes- Overrides:
 getAttributeNameSetin classRequest.Wrapper- Returns:
 - Set of attribute names, or an empty set if there are no attributes.
 
 - 
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 
 - 
getServletRequestState
- Specified by:
 getServletRequestStatein interfaceServletContextHandler.ServletRequestInfo
 - 
getServletChannel
- Specified by:
 getServletChannelin interfaceServletContextHandler.ServletRequestInfo
 - 
getServletApiRequest
 - 
getHttpServletResponse
public jakarta.servlet.http.HttpServletResponse getHttpServletResponse() - 
getServletName
 - 
getRequestAttributeListeners
- Specified by:
 getRequestAttributeListenersin interfaceServletContextHandler.ServletRequestInfo
 - 
addEventListener
 - 
removeEventListener
 - 
getManagedSession
- Specified by:
 getManagedSessionin interfaceServletContextHandler.ServletRequestInfo
 - 
setManagedSession
 - 
getSessionManager
- Specified by:
 getSessionManagerin interfaceServletContextHandler.ServletRequestInfo
 - 
setRequestedSession
 - 
getRequestedSession
- Specified by:
 getRequestedSessionin interfaceServletContextHandler.ServletRequestInfo
 - 
getSession
Description copied from interface:RequestGet a
Sessionassociated with the request. Sessions may not be supported by a given configuration, in which casenullwill be returned.- Specified by:
 getSessionin interfaceRequest- Overrides:
 getSessionin classRequest.Wrapper- Parameters:
 create- True if the session should be created for the request.- Returns:
 - The session associated with the request or 
null. 
 
 -