How to handle exceptions in spring mvc framework?

Answer Posted / nashiinformaticssolutions

There are two methods for managing exceptions in Spring MVC:

Exception handler method: The @ExceptionHandler annotation type is used to annotate a method to handle exceptions in this type of exception handling.

XML Configuration: The exception can be mapped by the user using the Simple Mapping Exception Resolver bean in the Spring application file.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between constructor injection and setter injection?

213


What are benefits of spring framework?

235


What is dao layer in spring?

219


What is the syntax to add a bean in the spring application?

206


Why we use @autowired in spring?

233






Why do we need view resolver in spring mvc and what is an internal view resolver in spring?

238


What are different types of autowire types?

200


What is the use of @service annotation?

222


Are singleton beans in spring a regular singleton object?

206


What is spring aop used for?

216


What is use of @qualifier in spring?

376


Explain what is spring mvc?

195


Is singleton thread safe in spring?

219


What is bean factory in spring?

205


How important is the spring bean configuration file?

237