public class

DefaultRedirectStrategy

extends Object
implements RedirectStrategy
java.lang.Object
   ↳ org.springframework.security.web.DefaultRedirectStrategy

Class Overview

Simple implementation of RedirectStrategy which is the default used throughout the framework.

Summary

Fields
protected final Log logger
Public Constructors
DefaultRedirectStrategy()
Public Methods
void sendRedirect(HttpServletRequest request, HttpServletResponse response, String url)
Redirects the response to the supplied URL.
void setContextRelative(boolean useRelativeContext)
If true, causes any redirection URLs to be calculated minus the protocol and context path (defaults to false).
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.security.web.RedirectStrategy

Fields

protected final Log logger

Public Constructors

public DefaultRedirectStrategy ()

Public Methods

public void sendRedirect (HttpServletRequest request, HttpServletResponse response, String url)

Redirects the response to the supplied URL.

If contextRelative is set, the redirect value will be the value after the request context path. Note that this will result in the loss of protocol information (HTTP or HTTPS), so will cause problems if a redirect is being performed to change to HTTPS, for example.

Parameters
request the current request
response the response to redirect
url the target URL to redirect to, for example "/login"
Throws
IOException

public void setContextRelative (boolean useRelativeContext)

If true, causes any redirection URLs to be calculated minus the protocol and context path (defaults to false).