user4903
user4903

Reputation:

Is it possible using Spring's @ExceptionHandler to get the handler that actually threw the exception?

It looks like HandlerExceptionResolver provides this functionality:

resolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)

I'm assuming "handler" is the handler that threw the exception. Can I get this in @ExceptionHandler, including all of the details that are associated with the request mapping for that handler?

Upvotes: 1

Views: 177

Answers (1)

skaffman
skaffman

Reputation: 403491

According to the javadoc, no, you can't. The list of permitted arguments types does not include information about the handler itself.

Upvotes: 2

Related Questions