springMvc中@ControllerAdvice的使用

@ControllerAdvice是一個@Component,用於定義@ExceptionHandler,@InitBinder和@ModelAttribute方法,適用於所有使用@RequestMapping方法。 通常情況下配合@ExceptionHandler使用 springMvc中如果單使用@ExceptionHandler,只能在當前Controller中處理異常。但當配合@Contr
相關文章
相關標籤/搜索