Spring Security Framework

org.springframework.security.ui
Class TargetUrlResolverImpl

java.lang.Object
  extended by org.springframework.security.ui.TargetUrlResolverImpl
All Implemented Interfaces:
TargetUrlResolver

public class TargetUrlResolverImpl
extends Object
implements TargetUrlResolver

Default implementation for TargetUrlResolver

Returns a target URL based from the contents of the configured targetUrlParameter if present on the current request. Failing that, the SavedRequest in the session will be used.

Since:
2.0
Version:
$Id$
Author:
Martino Piccinato, Luke Taylor

Field Summary
static String DEFAULT_TARGET_PARAMETER
           
 
Constructor Summary
TargetUrlResolverImpl()
           
 
Method Summary
 String determineTargetUrl(SavedRequest savedRequest, HttpServletRequest currentRequest, Authentication auth)
           
protected  boolean isJustUseSavedRequestOnGet()
           
 void setJustUseSavedRequestOnGet(boolean justUseSavedRequestOnGet)
           
 void setTargetUrlParameter(String targetUrlParameter)
          Before checking the SavedRequest, the current request will be checked for this parameter and the value used as the target URL if resent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TARGET_PARAMETER

public static String DEFAULT_TARGET_PARAMETER
Constructor Detail

TargetUrlResolverImpl

public TargetUrlResolverImpl()
Method Detail

determineTargetUrl

public String determineTargetUrl(SavedRequest savedRequest,
                                 HttpServletRequest currentRequest,
                                 Authentication auth)
Specified by:
determineTargetUrl in interface TargetUrlResolver
Parameters:
savedRequest - The request that initiated the authentication process
currentRequest - the current request
auth - The authentication token generated after successful authentication
Returns:
The URL to be used

isJustUseSavedRequestOnGet

protected boolean isJustUseSavedRequestOnGet()
Returns:
true if just GET request will be used to determine target URLs, false otherwise.

setJustUseSavedRequestOnGet

public void setJustUseSavedRequestOnGet(boolean justUseSavedRequestOnGet)
Parameters:
justUseSavedRequestOnGet - set to true if just GET request will be used to determine target URLs, false otherwise.

setTargetUrlParameter

public void setTargetUrlParameter(String targetUrlParameter)
Before checking the SavedRequest, the current request will be checked for this parameter and the value used as the target URL if resent.

Parameters:
targetUrlParameter - the name of the parameter containing the encoded target URL. Defaults to "redirect".

Spring Security Framework

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