public class BroadleafRedirectController
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
this code and force the browser to load the new page (e.g. via window.location)