title: Deactivate Jetty's default 404 error handler
body: <p>I want to provide a custom 404 error page in my Spring 3.1 web application, but I cannot deactivate Jetty 8's default 404 error page.</p>
  
  <p>Jetty 8, out of the box, provides a default 404 error page:
  when visiting a Jetty-hosted website, and providing a URL path that is not handled by any servlet (e.g. by visiting <code>http://www.example.com/nonexisting</code> ), Jetty responses with <em>its own default HTML error page</em>:</p>
  
  <pre><code>HTTP ERROR 404
  
  Problem accessing /nonexisting. Reason:
  
      Not Found
  Powered by Jetty://
  </code></pre>
  
  <p>To replace this default behavior,</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/a/4756211/923560">I've removed the <code>DefaultHandler</code> from my Jetty XML file</a>,</li>
  <li><a href="https://stackoverflow.com/a/7066536/923560">I've edited my <code>web.xml</code> to include both Servlet 2.5 and Servlet 3.0 error handler locations pointing to <code>/error</code></a>,</li>
  <li><a href="https://stackoverflow.com/a/1252763/923560">I've set up a dedicated <code>@Controller</code> for handling the request to <code>/error</code></a>,</li>
  </ul>
  
  <p>but my website still returns <em>Jetty's own default HTML error page</em>.</p>
  
  <p><a href="http://wiki.eclipse.org/Jetty/Howto/Custom_Error_Pages" rel="nofollow noreferrer">Jetty 8's official documentation talks about setting up a "custom error pages"</a>, but the suggestions there say</p>
  
  <ul>
  <li>to configure a custom Jetty error handler (I don't want to do this, I want to do it inside my own Spring <code>@Controller</code> as mentioned above)</li>
  <li>to create a "catch all context and create a "root" web app mapped to the <code>/</code> URI." (I don't want to do this as inside my <code>web.xml</code> I have already mapped Spring MVC's <code>DispatcherServlet</code> to /. </li>
  </ul>
  
  <p>How can I turn off Jetty's default error handler and have the error handling be done as pointed out above?</p>