Class DispatchUtils


  • public final class DispatchUtils
    extends java.lang.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 Detail

      • dispatchForward

        public static ServletPathMatch dispatchForward​(java.lang.String path,
                                                       HttpServletRequestImpl requestImpl,
                                                       HttpServletResponseImpl responseImpl,
                                                       ServletContextImpl servletContext)
                                                throws io.undertow.util.ParameterLimitException
        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
      • dispatchInclude

        public static ServletPathMatch dispatchInclude​(java.lang.String path,
                                                       HttpServletRequestImpl requestImpl,
                                                       HttpServletResponseImpl responseImpl,
                                                       ServletContextImpl servletContext)
                                                throws io.undertow.util.ParameterLimitException
        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
      • dispatchError

        public static ServletPathMatch dispatchError​(java.lang.String path,
                                                     java.lang.String servletName,
                                                     java.lang.Throwable exception,
                                                     java.lang.String message,
                                                     HttpServletRequestImpl requestImpl,
                                                     HttpServletResponseImpl responseImpl,
                                                     ServletContextImpl servletContext)
                                              throws io.undertow.util.ParameterLimitException
        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
      • dispatchAsync

        public static ServletPathMatch dispatchAsync​(java.lang.String path,
                                                     HttpServletRequestImpl requestImpl,
                                                     HttpServletResponseImpl responseImpl,
                                                     ServletContextImpl servletContext)
                                              throws io.undertow.util.ParameterLimitException
        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