Package io.undertow.servlet.util
Class DispatchUtils
java.lang.Object
io.undertow.servlet.util.DispatchUtils
Utility class to manage the dispatching parsing of the path. The methods fill the exchange, request and response with the needed data for the dispatch.
- Author:
- rmartinc
-
Method Summary
Modifier and TypeMethodDescriptionstatic ServletPathMatchdispatchAsync(String path, HttpServletRequestImpl requestImpl, HttpServletResponseImpl responseImpl, ServletContextImpl servletContext) Perform an async dispatch to a path assigning everything needed to the request, response and exchange.static ServletPathMatchdispatchError(String path, String servletName, Throwable exception, String message, HttpServletRequestImpl requestImpl, HttpServletResponseImpl responseImpl, ServletContextImpl servletContext) Perform a error dispatch to a path assigning everything needed to the request, response and exchange.static ServletPathMatchdispatchForward(String path, HttpServletRequestImpl requestImpl, HttpServletResponseImpl responseImpl, ServletContextImpl servletContext) Perform a forward dispatch to a path assigning everything needed to the request, response and exchange.static ServletPathMatchdispatchInclude(String path, HttpServletRequestImpl requestImpl, HttpServletResponseImpl responseImpl, ServletContextImpl servletContext) Perform an include dispatch to a path assigning everything needed to the request, response and exchange.
-
Method Details
-
dispatchForward
public static ServletPathMatch dispatchForward(String path, HttpServletRequestImpl requestImpl, HttpServletResponseImpl responseImpl, ServletContextImpl servletContext) throws ParameterLimitException, BadRequestException Perform a forward dispatch to a path assigning everything needed to the request, response and exchange.- Parameters:
path- The path to forward scoped to the ServletContextrequestImpl- The requestresponseImpl- The responseservletContext- The servlet context- Returns:
- The match for the path
- Throws:
ParameterLimitException- parameter limit exceededBadRequestException
-
dispatchInclude
public static ServletPathMatch dispatchInclude(String path, HttpServletRequestImpl requestImpl, HttpServletResponseImpl responseImpl, ServletContextImpl servletContext) throws ParameterLimitException, BadRequestException Perform an include dispatch to a path assigning everything needed to the request, response and exchange.- Parameters:
path- The path to include scoped to the ServletContextrequestImpl- The requestresponseImpl- The responseservletContext- The servlet context- Returns:
- The match for the path
- Throws:
ParameterLimitException- parameter limit exceededBadRequestException
-
dispatchError
public static ServletPathMatch dispatchError(String path, String servletName, Throwable exception, String message, HttpServletRequestImpl requestImpl, HttpServletResponseImpl responseImpl, ServletContextImpl servletContext) throws ParameterLimitException, BadRequestException Perform a error dispatch to a path assigning everything needed to the request, response and exchange.- Parameters:
path- The path to forward scoped to the ServletContextservletName- The servlet nameexception- The exception for the errormessage- The error messagerequestImpl- The requestresponseImpl- The responseservletContext- The servlet context- Returns:
- The match for the path
- Throws:
ParameterLimitException- parameter limit exceededBadRequestException
-
dispatchAsync
public static ServletPathMatch dispatchAsync(String path, HttpServletRequestImpl requestImpl, HttpServletResponseImpl responseImpl, ServletContextImpl servletContext) throws ParameterLimitException, BadRequestException Perform an async dispatch to a path assigning everything needed to the request, response and exchange.- Parameters:
path- The path to include scoped to the ServletContextrequestImpl- The requestresponseImpl- The responseservletContext- The servlet context- Returns:
- The match for the path
- Throws:
ParameterLimitException- parameter limit exceededBadRequestException
-