org.broadleafcommerce.common.web.controller
Class BroadleafRedirectController

java.lang.Object
  extended by org.broadleafcommerce.common.web.controller.BroadleafRedirectController

public class BroadleafRedirectController
extends Object

This controller works in conjunction with the broadleaf-ajax style redirect. The logic is quite complex but solves a problem related to redirects and an Ajax form. It is intended to solve a problem with using an Ajax style login modal along with Spring Security. Spring Security wants to redirect after a successful login. Unfortunately, we can reliably redirect from Spring Security to a page within the BLC system when the login modal is presented in Ajax. To solve this problem, Spring Security can be configured to use the BroadleafWindowLocationRedirectStrategy. That strategy will add an attribute to session for the page you want to redirect to if the request is coming in from an Ajax call. It will then cause a redirect that should be picked up by this controller. This controller will then render a page with the blc-redirect-div. The client-side javaScript (BLC.js) will intercept this code and force the browser to load the new page (e.g. via window.location)

Author:
bpolster
See Also:
BroadleafRedirectStrategy

Constructor Summary
BroadleafRedirectController()
           
 
Method Summary
 String redirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BroadleafRedirectController

public BroadleafRedirectController()
Method Detail

redirect

public String redirect(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response,
                       org.springframework.ui.Model model)


Copyright © 2013. All Rights Reserved.