diff --git a/web/src/main/java/org/springframework/security/web/DefaultRedirectStrategy.java b/web/src/main/java/org/springframework/security/web/DefaultRedirectStrategy.java index c968218b98..1341d567a7 100644 --- a/web/src/main/java/org/springframework/security/web/DefaultRedirectStrategy.java +++ b/web/src/main/java/org/springframework/security/web/DefaultRedirectStrategy.java @@ -13,24 +13,24 @@ import javax.servlet.http.HttpServletResponse; * @since 3.0 */ public class DefaultRedirectStrategy implements RedirectStrategy { - private boolean useRelativeContext; + private boolean contextRelative; /** * Redirects the response to the supplied URL. *
- * If useRelativeContext is set, the redirect value will be the value after the request context path. + * If contextRelative is set, the redirect value will be the value after the request context path. */ public void sendRedirect(HttpServletRequest request, HttpServletResponse response, String url) throws IOException { String finalUrl; if (!url.startsWith("http://") && !url.startsWith("https://")) { - if (useRelativeContext) { + if (contextRelative) { finalUrl = url; } else { finalUrl = request.getContextPath() + url; } } - else if (useRelativeContext) { + else if (contextRelative) { // Calculate the relative URL from the fully qualifed URL, minus the protocol and base context. int len = request.getContextPath().length(); int index = url.indexOf(request.getContextPath()) + len; @@ -51,8 +51,8 @@ public class DefaultRedirectStrategy implements RedirectStrategy { * If true, causes any redirection URLs to be calculated minus the protocol * and context path (defaults to false). */ - public void setUseRelativeContext(boolean useRelativeContext) { - this.useRelativeContext = useRelativeContext; + public void setContextRelative(boolean useRelativeContext) { + this.contextRelative = useRelativeContext; } }