0
我有一個GlobalExceptionhandler:如何用Spring框架實現Default Exception Handler?
@ControllerAdvice
public class GlobalExceptionHandler {
@ResponseStatus(HttpStatus.NOT_FOUND)
@ExceptionHandler(FooException.class)
public ModelAndView alreadyVerifiedExceptionHandler(FooException ex) {
ModelAndView response = new ModelAndView();
response.addObject("status", ex.getStatus());
response.addObject("errorCode", ex.getErrorCode());
response.addObject("errorMessage", ex.getErrorMessage());
return response;
}
.....
}
我有幾個的ExceptionHandler,我將有一個的ExceptionHandler默認。怎麼做?
春季版本:3.2.3