public class NavigationHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
NEXT_URL_PARAMETER_NAME |
Constructor and Description |
---|
NavigationHelper() |
Modifier and Type | Method and Description |
---|---|
static String |
calculateSafeNextUrlForRedirect(Supplier<String> nextUrlSupplier,
String defaultLocation,
Function<String,String> contextPathMapper)
Calculates next url based on "next" request parameter
|
protected static boolean |
isLocalPath(URI uri) |
static Supplier<String> |
requestParamNextUrlSupplier(javax.servlet.http.HttpServletRequest request) |
static Optional<String> |
safeUrlForRedirect(String url) |
static Function<String,String> |
withContextPath(javax.servlet.http.HttpServletRequest httpServletRequest) |
static Function<String,String> |
withoutContextPath() |
public static final String NEXT_URL_PARAMETER_NAME
public static String calculateSafeNextUrlForRedirect(Supplier<String> nextUrlSupplier, String defaultLocation, Function<String,String> contextPathMapper)
nextUrlSupplier
- supply the next url to calculatedefaultLocation
- default location which will be used if next url cannot be calculatedcontextPathMapper
- function to map context path on the calculated urlpublic static Supplier<String> requestParamNextUrlSupplier(javax.servlet.http.HttpServletRequest request)
public static Function<String,String> withContextPath(javax.servlet.http.HttpServletRequest httpServletRequest)
protected static boolean isLocalPath(URI uri)
Copyright © 2020 Atlassian. All rights reserved.