SpringMVC異常處理的三種方式

1、使用 @ExceptionHandler 註解 該方式進行異常處理的方法必須與出錯的方法在同一個Controller裏面。使用以下:web // 這個異常處理只會在本類中起做用 @ExceptionHandler(RuntimeException.class) public String catchException(RuntimeException e){ System.out.p
相關文章
相關標籤/搜索