Class RedirectUtil
java.lang.Object
org.eclipse.jetty.rewrite.handler.RedirectUtil
Utility for managing redirect based rules
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
toRedirectURL
(jakarta.servlet.http.HttpServletRequest request, String location) Common point to generate a proper "Location" header for redirects.
-
Constructor Details
-
RedirectUtil
public RedirectUtil()
-
-
Method Details
-
toRedirectURL
public static String toRedirectURL(jakarta.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...)
-