Class RedirectBuilder


  • public class RedirectBuilder
    extends Object
    Utility class for building redirects.
    Author:
    Stuart Douglas
    • Field Detail

      • UTF_8

        public static final String UTF_8
    • Method Detail

      • redirect

        public static String redirect​(HttpServerExchange exchange,
                                      String newRelativePath)
        Redirects to a new relative path. All other data from the exchange is preserved.
        Parameters:
        exchange - The HTTP server exchange
        newRelativePath - The new relative path
        Returns:
      • redirect

        public static String redirect​(HttpServerExchange exchange,
                                      String newRelativePath,
                                      boolean includeParameters)
        Redirects to a new relative path. All other data from the exchange is preserved.
        Parameters:
        exchange - The HTTP server exchange
        newRelativePath - The new relative path
        includeParameters - If query and path parameters from the exchange should be included
        Returns: