SpringMVC异常处理的三种方式

1、使用 @ExceptionHandler 注解 该方式进行异常处理的方法必须与出错的方法在同一个Controller里面。使用以下:web // 这个异常处理只会在本类中起做用 @ExceptionHandler(RuntimeException.class) public String catchException(RuntimeException e){ System.out.p
相关文章
相关标签/搜索