org.springframework.security.web
Class DefaultRedirectStrategy

java.lang.Object
  extended by org.springframework.security.web.DefaultRedirectStrategy
All Implemented Interfaces:
RedirectStrategy

public class DefaultRedirectStrategy
extends Object
implements RedirectStrategy

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

Since:
3.0
Version:
$Id: DefaultRedirectStrategy.java 4072 2009-12-18 18:04:03Z ltaylor $
Author:
Luke Taylor

Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
DefaultRedirectStrategy()
           
 
Method Summary
 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).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

DefaultRedirectStrategy

public DefaultRedirectStrategy()
Method Detail

sendRedirect

public void sendRedirect(HttpServletRequest request,
                         HttpServletResponse response,
                         String url)
                  throws IOException
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.

Specified by:
sendRedirect in interface RedirectStrategy
Parameters:
request - the current request
response - the response to redirect
url - the target URL to redirect to, for example "/login"
Throws:
IOException

setContextRelative

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



Copyright © 2004-2009 SpringSource, Inc. All Rights Reserved.