Working with HandlerExceptionResolver
Spring MVC provides several approaches to exception handling. In Spring, one of the main exception handling constructs is the HandlerExceptionResolver
(org.springframework.web.servlet.HandlerExceptionResolver
) interface. Any objects that implement this interface can resolve exceptions thrown during Controller mapping or execution. HandlerExceptionResolver
implementers are typically registered as beans in the web application context.
Spring MVC creates two such HandlerExceptionResolver
implementations by default to facilitate exception handling:
ResponseStatusExceptionResolver
is created to support the@ResponseStatus
annotation
ExceptionHandlerExceptionResolver
is created to support the@ExceptionHandler
annotation ...
Get Spring MVC Beginner’s Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.