捕捉指定异常,跳转到我们设置的异常页面,也可以配置多个,如下:
@ExceptionMappings({
@ExceptionMapping(exception = "org.apache.shiro.authc.UnknownAccountException",
result = "unauthorized"),@ExceptionMapping(exception = "org.apache.shiro.authc.IncorrectCredentialsException",
result = "unauthorized2")})
@Results({@Result(name = "unauthorized", location = "/404.html"),@Result(name = "unauthorized2", location = "/500.html")})