Class DispatchUtils

java.lang.Object
io.undertow.servlet.util.DispatchUtils

public final class DispatchUtils extends Object

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 Details

    • dispatchForward

      public static ServletPathMatch dispatchForward(String path, HttpServletRequestImpl requestImpl, HttpServletResponseImpl responseImpl, ServletContextImpl servletContext) throws io.undertow.util.ParameterLimitException, io.undertow.util.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 ServletContext
      requestImpl - The request
      responseImpl - The response
      servletContext - The servlet context
      Returns:
      The match for the path
      Throws:
      io.undertow.util.ParameterLimitException - parameter limit exceeded
      io.undertow.util.BadRequestException
    • dispatchInclude

      public static ServletPathMatch dispatchInclude(String path, HttpServletRequestImpl requestImpl, HttpServletResponseImpl responseImpl, ServletContextImpl servletContext) throws io.undertow.util.ParameterLimitException, io.undertow.util.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 ServletContext
      requestImpl - The request
      responseImpl - The response
      servletContext - The servlet context
      Returns:
      The match for the path
      Throws:
      io.undertow.util.ParameterLimitException - parameter limit exceeded
      io.undertow.util.BadRequestException
    • dispatchError

      public static ServletPathMatch dispatchError(String path, String servletName, Throwable exception, String message, HttpServletRequestImpl requestImpl, HttpServletResponseImpl responseImpl, ServletContextImpl servletContext) throws io.undertow.util.ParameterLimitException, io.undertow.util.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 ServletContext
      servletName - The servlet name
      exception - The exception for the error
      message - The error message
      requestImpl - The request
      responseImpl - The response
      servletContext - The servlet context
      Returns:
      The match for the path
      Throws:
      io.undertow.util.ParameterLimitException - parameter limit exceeded
      io.undertow.util.BadRequestException
    • dispatchAsync

      public static ServletPathMatch dispatchAsync(String path, HttpServletRequestImpl requestImpl, HttpServletResponseImpl responseImpl, ServletContextImpl servletContext) throws io.undertow.util.ParameterLimitException, io.undertow.util.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 ServletContext
      requestImpl - The request
      responseImpl - The response
      servletContext - The servlet context
      Returns:
      The match for the path
      Throws:
      io.undertow.util.ParameterLimitException - parameter limit exceeded
      io.undertow.util.BadRequestException