spring 异常处理

1. 实现接口 HandlerExceptionResolver 捕获异常

2.@ExceptionHandler 在方法添加注解,捕获本地controller异常

3.@ControllerAdvice +@ExceptionHandler 共同作用实现捕获多个controller异常

 

posted @ 2018-01-16 19:45  newlangwen  阅读(129)  评论(0编辑  收藏  举报