@ExceptionHandler for all controllers in spring-mvc
问题 I have wrote following controller to handle all exception in my code: @Controller public class ErrorHandlerController { @ExceptionHandler(value = Exception.class) public String redirectToErrorPage(Model model){ model.addAttribute("message", "error on server"); return "errorPage"; } } But looks like following exception handler will work only if exception throws inside ErrorHandlerController I have a huge count of controllers. Please advice me how to write one ExceptionHandler for all