}
public void setAlwaysUsePostLoginUrl(boolean alwaysUsePostLoginUrl) {
AuthenticationSuccessHandler successHandler = getSuccessHandler();
if (successHandler instanceof AbstractAuthenticationTargetUrlRequestHandler) {
AbstractAuthenticationTargetUrlRequestHandler h = (AbstractAuthenticationTargetUrlRequestHandler) successHandler;
h.setAlwaysUseDefaultTargetUrl(alwaysUsePostLoginUrl);
} else {
throw new IllegalStateException("can't set alwaysUsePostLoginUrl on unknown successHandler, type is " + successHandler.getClass().getName());
}
}