views:

27

answers:

1

I wanted to use HandlerExceptionResolver to handle exceptions related to request issues such as 404 and other error codes. Tomcat seems to respond to these errors without looking at Spring. Is there a way to make HandlerExceptionResolver respond to 404 errors.

I know that configuring web.xml and using <error-page> will work. But is there a way to do this by registering the HandlerExceptionResolver or something similar to that using Spring MVC?

A: 

Exceptions and HTTP Response error codes are two different things. Spring's HandlerExceptionResolver can be used to resolve exceptions but not error codes. web.xml is the best place to handle error codes.

Samit G.