Spring security Spring如何处理AuthenticationServiceException与AbstractUserDetailsAuthenticationProvider中的BadCredentialsException进行比较

Spring security Spring如何处理AuthenticationServiceException与AbstractUserDetailsAuthenticationProvider中的BadCredentialsException进行比较,spring-security,Spring Security,当我从AbstractUserDetailsAuthenticationProvider的具体类中抛出一个带有消息的BadCredentialsException时,它已由spring处理,并显示默认失败jsp中存在的相应消息 但是当从同一个类抛出AuthenticationServiceException时,spring无法处理它,而是显示堆栈跟踪。我注意到,在这种情况下,spring无法重定向到默认的失败jsp BadCredentialsException和AuthenticationSe

当我从
AbstractUserDetailsAuthenticationProvider的
具体类中抛出一个带有消息的
BadCredentialsException
时,它已由spring处理,并显示默认失败jsp中存在的相应消息

但是当从同一个类抛出
AuthenticationServiceException
时,spring无法处理它,而是显示堆栈跟踪。我注意到,在这种情况下,spring无法重定向到默认的失败jsp

  • BadCredentialsException和AuthenticationServiceException都是AuthenticationException的子类,那么为什么spring安全性处理方式不同呢
  • 有什么地方需要设置他的配置文件吗
  • 没有处理AuthenticationServiceException的具体原因是什么
    当用户尝试进行身份验证时是否引发未处理异常?发布代码/配置。我们不喜欢猜测。告诉我们何时引发此异常。