- Mastering Spring 5.0
- Ranga Rao Karanam
- 64字
- 2021-07-02 22:12:19
Specific exception handling in a Controller
In some situations, there is a need for specific exception handling in a Controller. This situation can easily be handled by implementing a method annotated with @ExceptionHandler(value = Exception.class).
In case specific exception handling is needed only for a specific exception, the specific exception class can be provided as the value for the value attribute of the annotation.