Class RedirectUtil

java.lang.Object
org.eclipse.jetty.rewrite.handler.RedirectUtil

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

    • RedirectUtil

      public RedirectUtil()
  • Method Details

    • toRedirectURL

      public static String toRedirectURL(javax.servlet.http.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...)