In this tutorial, JavaSampleApproach introduces ways to handle Errors: catch Exception and fall back, recover from errors, deal with backpressure errors…
We had discussed about @ExceptionHandler, @ResponseStatus, @ControllerAdvice in How to use Spring Exception Handler for SpringMVC: @ExceptionHandler, @ResponseStatus, @ControllerAdvice. In the tutorial, JavaSampleApproach will guide to how to use a new feature of Spring Framework 4.3: @RestControllerAdvice.
Spring provides a cross-cutting concern solution for handling Java Excepion. So in the tutorial, JavaSampleApproach will guide how to use Spring Exception with: @ResponseStatus, @ExceptionHandler & @ControllerAdvice.
– How to handle Java Exception
– How to use @RestControllerAdvice – New Features of Spring Framework 4.3
We had introduced JavaException in 2 articles: Understand Java Exception & The effect to Java Program (Single & Multi Thread) & How to work with Java Custom Exception. In the tutorial, JavaSampleApproach will guide how to handle Java Exception.
– How to use Spring Exception Handler for SpringMVC: @ExceptionHandler, @ResponseStatus, @ControllerAdvice
Java 7 provides a new approach for closing resources with clean & clear code by try-with-resources statment. In the article, JavaSampleApproach will introduce the benifit when programming by try-with-resources statement.
Exception handling is important in software development, Java 8 CompletableFuture also provides methods to handle errors when they occurs.