Package io.undertow.servlet.handlers
Class ServletRequestContext
java.lang.Object
io.undertow.servlet.handlers.ServletRequestContext
All the information that servlet needs to attach to the exchange.
This is all stored under this class, rather than using individual attachments, as this approach has significant performance advantages.
The ServletInitialHandler also pushed this information to the CURRENT
thread local, which allows it to be access even if the request or response have been
wrapped with non-compliant wrapper classes.
- Author:
- Stuart Douglas
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionServletRequestContext(Deployment deployment, HttpServletRequestImpl originalRequest, HttpServletResponseImpl originalResponse, ServletPathMatch originalServletPathMatch) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic ServletRequestContextcurrent()booleanjakarta.servlet.DispatcherTypeintjakarta.servlet.ServletRequestjakarta.servlet.ServletResponsebooleanbooleanstatic ServletRequestContextvoidsetAsyncSupported(boolean asyncSupported) static voidsetCurrentRequestContext(ServletRequestContext servletRequestContext) voidsetCurrentServlet(ServletChain currentServlet) voidsetCurrentServletContext(ServletContextImpl currentServletContext) voidsetDispatcherType(jakarta.servlet.DispatcherType dispatcherType) voidvoidsetOverridenSessionId(String overridenSessionId) voidsetRequiredConstrains(List<SingleConstraintMatch> requiredConstrains) voidsetRunningInsideHandler(boolean runningInsideHandler) voidsetServletPathMatch(ServletPathMatch servletPathMatch) voidsetServletRequest(jakarta.servlet.ServletRequest servletRequest) voidsetServletResponse(jakarta.servlet.ServletResponse servletResponse) voidsetSession(HttpSessionImpl session) voidsetTransportGuarenteeType(TransportGuaranteeType transportGuarenteeType)
-
Field Details
-
ATTACHMENT_KEY
-
-
Constructor Details
-
ServletRequestContext
public ServletRequestContext(Deployment deployment, HttpServletRequestImpl originalRequest, HttpServletResponseImpl originalResponse, ServletPathMatch originalServletPathMatch)
-
-
Method Details
-
setCurrentRequestContext
-
clearCurrentServletAttachments
public static void clearCurrentServletAttachments() -
requireCurrent
-
current
-
getDeployment
-
getCurrentServlet
-
setCurrentServlet
-
getServletPathMatch
-
setServletPathMatch
-
getRequiredConstrains
-
setRequiredConstrains
-
getTransportGuarenteeType
-
setTransportGuarenteeType
-
getServletResponse
public jakarta.servlet.ServletResponse getServletResponse() -
setServletResponse
public void setServletResponse(jakarta.servlet.ServletResponse servletResponse) -
getServletRequest
public jakarta.servlet.ServletRequest getServletRequest() -
setServletRequest
public void setServletRequest(jakarta.servlet.ServletRequest servletRequest) -
getDispatcherType
public jakarta.servlet.DispatcherType getDispatcherType() -
setDispatcherType
public void setDispatcherType(jakarta.servlet.DispatcherType dispatcherType) -
getOriginalRequest
-
getOriginalResponse
-
getSession
-
setSession
-
getExchange
-
getOriginalServletPathMatch
-
getCurrentServletContext
-
setCurrentServletContext
-
displayStackTraces
public boolean displayStackTraces() -
setError
-
getErrorCode
public int getErrorCode() -
getErrorMessage
-
isRunningInsideHandler
public boolean isRunningInsideHandler() -
setRunningInsideHandler
public void setRunningInsideHandler(boolean runningInsideHandler) -
isAsyncSupported
public boolean isAsyncSupported() -
getOverridenSessionId
-
setOverridenSessionId
-
setAsyncSupported
public void setAsyncSupported(boolean asyncSupported)
-