



If there are multiple exception handler methods defined, then handler method that is closest to the Exception class is used. We can also send JSON error response, that we will look later on in our example. These exception handler methods are just like other request handler methods and we can build error response and respond with different error page. So if we have defined one of these for Exception class, then all the exceptions thrown by our request handler method will have handled. This annotation takes Exception class as argument. All we need is to annotate these methods with annotation.
