Top Description Constructors Methods
io.undertow.servlet.util

public final Class DispatchUtils

extends Object
Class Inheritance
Imports
io.undertow.server.Connectors, .HttpServerExchange, io.undertow.servlet.handlers.ServletPathMatch, .ServletRequestContext, io.undertow.servlet.spec.HttpServletRequestImpl, .HttpServletResponseImpl, .ServletContextImpl, io.undertow.util.ParameterLimitException, jakarta.servlet.ServletException, java.util.Deque, .Map

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

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static String
assignRequestPath(final String path, final HttpServletRequestImpl requestImpl, final ServletContextImpl servletContext, final boolean include)

public static ServletPathMatch

Returns:

The match for the path
dispatchAsync
(final String
The path to include scoped to the ServletContext
path
,
final HttpServletRequestImpl
The request
requestImpl
,
final HttpServletResponseImpl
The response
responseImpl
,
final ServletContextImpl
The servlet context
servletContext
)

Perform an async dispatch to a path assigning everything needed to the request, response and exchange.

public static ServletPathMatch

Returns:

The match for the path
dispatchError
(final String
The path to forward scoped to the ServletContext
path
,
final String
The servlet name
servletName
,
final Throwable
The exception for the error
exception
,
final String
The error message
message
,
final HttpServletRequestImpl
The request
requestImpl
,
final HttpServletResponseImpl
The response
responseImpl
,
final ServletContextImpl
The servlet context
servletContext
)

Perform a error dispatch to a path assigning everything needed to the request, response and exchange.

public static ServletPathMatch

Returns:

The match for the path
dispatchForward
(final String
The path to forward scoped to the ServletContext
path
,
final HttpServletRequestImpl
The request
requestImpl
,
final HttpServletResponseImpl
The response
responseImpl
,
final ServletContextImpl
The servlet context
servletContext
)

Perform a forward dispatch to a path assigning everything needed to the request, response and exchange.

public static ServletPathMatch

Returns:

The match for the path
dispatchInclude
(final String
The path to include scoped to the ServletContext
path
,
final HttpServletRequestImpl
The request
requestImpl
,
final HttpServletResponseImpl
The response
responseImpl
,
final ServletContextImpl
The servlet context
servletContext
)

Perform an include dispatch to a path assigning everything needed to the request, response and exchange.

private static Map<String, Deque<String>>
mergeQueryParameters(final Map<String, Deque<String>> newParams, final Map<String, Deque<String>> oldParams)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DispatchUtilsback to summary
private DispatchUtils()

Method Detail

assignRequestPathback to summary
private static String assignRequestPath(final String path, final HttpServletRequestImpl requestImpl, final ServletContextImpl servletContext, final boolean include) throws ParameterLimitException
dispatchAsyncback to summary
public static ServletPathMatch dispatchAsync(final String path, final HttpServletRequestImpl requestImpl, final HttpServletResponseImpl responseImpl, final ServletContextImpl servletContext) throws ParameterLimitException

Perform an async dispatch to a path assigning everything needed to the request, response and exchange.

Parameters
path:String

The path to include scoped to the ServletContext

requestImpl:HttpServletRequestImpl

The request

responseImpl:HttpServletResponseImpl

The response

servletContext:ServletContextImpl

The servlet context

Returns:ServletPathMatch

The match for the path

Exceptions
ParameterLimitException:
parameter limit exceeded
dispatchErrorback to summary
public static ServletPathMatch dispatchError(final String path, final String servletName, final Throwable exception, final String message, final HttpServletRequestImpl requestImpl, final HttpServletResponseImpl responseImpl, final ServletContextImpl servletContext) throws ParameterLimitException

Perform a error dispatch to a path assigning everything needed to the request, response and exchange.

Parameters
path:String

The path to forward scoped to the ServletContext

servletName:String

The servlet name

exception:Throwable

The exception for the error

message:String

The error message

requestImpl:HttpServletRequestImpl

The request

responseImpl:HttpServletResponseImpl

The response

servletContext:ServletContextImpl

The servlet context

Returns:ServletPathMatch

The match for the path

Exceptions
ParameterLimitException:
parameter limit exceeded
dispatchForwardback to summary
public static ServletPathMatch dispatchForward(final String path, final HttpServletRequestImpl requestImpl, final HttpServletResponseImpl responseImpl, final ServletContextImpl servletContext) throws ParameterLimitException

Perform a forward dispatch to a path assigning everything needed to the request, response and exchange.

Parameters
path:String

The path to forward scoped to the ServletContext

requestImpl:HttpServletRequestImpl

The request

responseImpl:HttpServletResponseImpl

The response

servletContext:ServletContextImpl

The servlet context

Returns:ServletPathMatch

The match for the path

Exceptions
ParameterLimitException:
parameter limit exceeded
dispatchIncludeback to summary
public static ServletPathMatch dispatchInclude(final String path, final HttpServletRequestImpl requestImpl, final HttpServletResponseImpl responseImpl, final ServletContextImpl servletContext) throws ParameterLimitException

Perform an include dispatch to a path assigning everything needed to the request, response and exchange.

Parameters
path:String

The path to include scoped to the ServletContext

requestImpl:HttpServletRequestImpl

The request

responseImpl:HttpServletResponseImpl

The response

servletContext:ServletContextImpl

The servlet context

Returns:ServletPathMatch

The match for the path

Exceptions
ParameterLimitException:
parameter limit exceeded
mergeQueryParametersback to summary
private static Map<String, Deque<String>> mergeQueryParameters(final Map<String, Deque<String>> newParams, final Map<String, Deque<String>> oldParams)