title: Spring 3 controller exception handler implementation problems
body: <p>I was hoping to implement a single "ExceptionController" to handle exceptions that are thrown in execution of my other controllers' methods. I hadn't specified any HandlerExceptionResolver in my application context so according to the <a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/web/servlet/DispatcherServlet.html" rel="noreferrer">API documentation</a> the AnnotationMethodHandlerExceptionResolver should be started. I verified it as such in the source. So why doesn't the following work?</p>
  
  <pre><code>@Controller
  public class ExceptionController {
  
    @ExceptionHandler(NullPointerException.class)
    public ModelAndView handleNullPointerException(NullPointerException ex) {
      // Do some stuff
      log.error(logging stuff)
      return myModelAndView;
    }
  }
  
  @Controller
  public class AnotherController {
  
    @RequestMapping(value="/nullpointerpath")
    public String throwNullPointer() {
      throw new NullPointerException();
    }
  }
  </code></pre>
  
  <p>I see in the debug logs that the three default exception handlers are asked for handling of the exception, but nothing is done and I see "DispatcherServlet - Could not complete request". Followed by the user being displayed the stacktrace and a 500 Internal error. </p>