OK - So I changed the login method to looks like this:
I catch the exceptions on the client side like this:public void login(String username, String password)
{
Authentication authentication =
new UsernamePasswordAuthenticationToken(
username,
password);
authentication =
authenticationManager.
authenticate(authentication);
if (authentication.isAuthenticated())
{
SecurityContextHolder.getContext().setAuthenticati on(authentication);
};
}
I think DWR automatically converts subclasses of java.lang.exception with the following in the configuration file:Code:var authenticationErrorHandler = function(errorString, exception) { console.log("This execption occurred: " + exception.javaClassName); console.log("ERROR STRING IS: " + errorString); if (exception.javaClassName == "org.springframework.security.BadCredentialsException") { console.log("This occurred: org.springframework.security.BadCredentialsException"); } else { console.log("Authentication Service Offline. Try later."); } }; var authenticationCallParameters = { async: false, callback: function() {console.log("Authentication Attempted");}, errorHandler:this.authenticationErrorHandler } AuthenticationService.login( "ole", "olespassword", authenticationCallParameters); AuthenticationService.login( "ole", "wrongpassword", authenticationCallParameters);
Code:<dwr:configuration> <dwr:convert type="exception" class="java.lang.Exception"> </dwr:convert> </dwr:configuration>


