title: Throw 404 and redirect to a custom error page in Spring
body: <p>I have the below piece of exception handler that redirects to "notfound" page when the resource is not found. But, in the apache logs, I am not seeing 404 error code. Is there any way to get a 404 error thrown by this exception handler?</p>
  
  <pre><code>@ExceptionHandler(UnknownIdentifierException.class)
  public String handleUnknownIdentifierException(final UnknownIdentifierException e, final HttpServletRequest request)
  {
      request.setAttribute("message", e.getMessage());
      return "forward:notfoundpage";
  }
  </code></pre>