title: 404 Exception not handled in Spring ControllerAdvice
body: <p>I have a simple Spring MVC application in which I want to handle all the unmapped urls using <code>@ControllerAdvice</code>.
  Here is the controller:</p>
  
  <pre><code>@ControllerAdvice
  public class ExceptionHandlerController {
      @ResponseStatus(HttpStatus.NOT_FOUND)
      @ExceptionHandler(NoHandlerFoundException.class)
      public String handle404() {
          return "exceptions/404page";
      }
  }
  </code></pre>
  
  <p>Still, every time get Whitelabel Error Page.</p>
  
  <p>I tried using <code>RuntimeException.class</code>, <code>HttpStatus.BAD_REQUEST</code> and extending the class with <code>NoHandlerFoundException</code> but no use.</p>
  
  <p>Any suggestions?</p>