|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler
public abstract class AbstractAuthenticationTargetUrlRequestHandler
Base class containing the logic used by strategies which handle redirection to a URL and
are passed an Authentication object as part of the contract.
See AuthenticationSuccessHandler
and
LogoutSuccessHandler
, for example.
Uses the following logic sequence to determine how it should handle the forward/redirect
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_TARGET_PARAMETER
|
protected org.apache.commons.logging.Log |
logger
|
Constructor Summary | |
---|---|
protected |
AbstractAuthenticationTargetUrlRequestHandler()
|
Method Summary | |
---|---|
protected java.lang.String |
determineTargetUrl(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
protected java.lang.String |
getDefaultTargetUrl()
Supplies the default target Url that will be used if no saved request is found or the alwaysUseDefaultTargetUrl property is set to true. |
protected RedirectStrategy |
getRedirectStrategy()
|
protected java.lang.String |
getTargetUrlParameter()
|
protected void |
handle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Authentication authentication)
|
protected boolean |
isAlwaysUseDefaultTargetUrl()
|
void |
setAlwaysUseDefaultTargetUrl(boolean alwaysUseDefaultTargetUrl)
If true , will always redirect to the value of defaultTargetUrl
(defaults to false ). |
void |
setDefaultTargetUrl(java.lang.String defaultTargetUrl)
Supplies the default target Url that will be used if no saved request is found in the session, or the alwaysUseDefaultTargetUrl property is set to true. |
void |
setRedirectStrategy(RedirectStrategy redirectStrategy)
Allows overriding of the behaviour when redirecting to a target URL. |
void |
setTargetUrlParameter(java.lang.String targetUrlParameter)
The current request will be checked for this parameter before and the value used as the target URL if present. |
void |
setUseReferer(boolean useReferer)
If set to true the Referer header will be used (if available). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String DEFAULT_TARGET_PARAMETER
protected final org.apache.commons.logging.Log logger
Constructor Detail |
---|
protected AbstractAuthenticationTargetUrlRequestHandler()
Method Detail |
---|
protected void handle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Authentication authentication) throws java.io.IOException, javax.servlet.ServletException
java.io.IOException
javax.servlet.ServletException
protected java.lang.String determineTargetUrl(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected java.lang.String getDefaultTargetUrl()
public void setDefaultTargetUrl(java.lang.String defaultTargetUrl)
/
.
Alternatively, inclusion of a scheme name (such as "http://" or "https://") as the prefix will denote a
fully-qualified URL and this is also supported.
defaultTargetUrl
- public void setAlwaysUseDefaultTargetUrl(boolean alwaysUseDefaultTargetUrl)
true
, will always redirect to the value of defaultTargetUrl
(defaults to false
).
protected boolean isAlwaysUseDefaultTargetUrl()
public void setTargetUrlParameter(java.lang.String targetUrlParameter)
targetUrlParameter
- the name of the parameter containing the encoded target URL. Defaults
to "redirect".protected java.lang.String getTargetUrlParameter()
public void setRedirectStrategy(RedirectStrategy redirectStrategy)
protected RedirectStrategy getRedirectStrategy()
public void setUseReferer(boolean useReferer)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |