title: How to declare ExceptionHandlerExceptionResolver in Java code?
body: <p>I was reading this article <a href="http://spring.io/blog/2013/11/01/exception-handling-in-spring-mvc##extending-exceptionhandlerexceptionresolver" rel="nofollow noreferrer">Exception Handling in Spring MVC</a>, and I don't understand why class extending <code>ExceptionHandlerExceptionResolver</code> doesn't have any annotations to it.</p>
  <p>It should be a bean, right? So it must be annotated with <code>@Component</code> (or maybe <code>@Service</code>, but I'm not sure if it belongs to a service layer) annotation or something?</p>
  <p>So why it does not have any annotations and how then Spring knows that it's a bean and that it should be used?</p>