Class RedirectUtil


  • public final class RedirectUtil
    extends Object
    Utility for managing redirect based rules
    • Constructor Detail

      • RedirectUtil

        public RedirectUtil()
    • Method Detail

      • toRedirectURL

        public static String toRedirectURL​(HttpServletRequest request,
                                           String location)
        Common point to generate a proper "Location" header for redirects.
        Parameters:
        request - the request the redirect should be based on (needed when relative locations are provided, so that server name, scheme, port can be built out properly)
        location - the location URL to redirect to (can be a relative path)
        Returns:
        the full redirect "Location" URL (including scheme, host, port, path, etc...)