org.broadleafcommerce.common.web.security
Class BroadleafAuthenticationFailureRedirectStrategy

java.lang.Object
  extended by org.broadleafcommerce.common.web.security.BroadleafAuthenticationFailureRedirectStrategy
All Implemented Interfaces:
org.springframework.security.web.RedirectStrategy

@Component(value="blAuthenticationFailureRedirectStrategy")
public class BroadleafAuthenticationFailureRedirectStrategy
extends Object
implements org.springframework.security.web.RedirectStrategy

Extends the Spring DefaultRedirectStrategy with support for ajax redirects. Designed for use with SpringSecurity when errors are present. Tacks on the BLC_AJAX_PARAMETER=true to the redirect request if the request is an ajax request. This will cause the resulting controller (e.g. LoginController) to treat the request as if it is coming from Ajax and return the related page fragment rather than returning the full view of the page.

Author:
bpolster

Constructor Summary
BroadleafAuthenticationFailureRedirectStrategy()
           
 
Method Summary
 org.springframework.security.web.RedirectStrategy getRedirectStrategy()
           
 void sendRedirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String url)
           
 void setRedirectStrategy(org.springframework.security.web.RedirectStrategy redirectStrategy)
           
 String updateUrlForAjax(String url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BroadleafAuthenticationFailureRedirectStrategy

public BroadleafAuthenticationFailureRedirectStrategy()
Method Detail

sendRedirect

public void sendRedirect(javax.servlet.http.HttpServletRequest request,
                         javax.servlet.http.HttpServletResponse response,
                         String url)
                  throws IOException
Specified by:
sendRedirect in interface org.springframework.security.web.RedirectStrategy
Throws:
IOException

updateUrlForAjax

public String updateUrlForAjax(String url)

getRedirectStrategy

public org.springframework.security.web.RedirectStrategy getRedirectStrategy()

setRedirectStrategy

public void setRedirectStrategy(org.springframework.security.web.RedirectStrategy redirectStrategy)


Copyright © 2012. All Rights Reserved.