Spring 3.2 introduces new annotation @ControllerAdvice annotation used for defining the exception handler with specific exception details for each method If any exception thrown on any part of the application will be handled by this component. In the previous release, we have configured GlobalException handling elements in the configuration files. With this new feature, it becomes more simple to handle the exceptions. Lets look at the example below to know how to implement in your project.
Showing posts with label Spring-annotaion. Show all posts
Showing posts with label Spring-annotaion. Show all posts
Saturday, 4 May 2019
Explain @ControllerAdvice in Spring
Spring 3.2 introduces new annotation @ControllerAdvice annotation used for defining the exception handler with specific exception details for each method If any exception thrown on any part of the application will be handled by this component. In the previous release, we have configured GlobalException handling elements in the configuration files. With this new feature, it becomes more simple to handle the exceptions. Lets look at the example below to know how to implement in your project.
Subscribe to:
Posts (Atom)
Spring Boot @ConfigurationProperties and Properties File
In this tutorial, you will learn to use @ConfigurationProperties to map properties files to POJO classes in Spring Boot application. Let’s ...
-
There are so many differences between hibernate and jdbc, as follows 1) Hibernate is data base independent, your code will work for all ...
-
Spring 3.0 has introduced new way for configuring the spring beans. In fact this option was maintained by spring framework separately as Ja...
-
session.save() : Save does an insert and will fail if the primary key is already persistent. session.saveOrUpdate() : saveOrUpdate does ...