title: Disable all default HTTP error response content in Tomcat
body: <p>By default, Tomcat sends some HTML content back to the client if it encounters something like an HTTP 404. I know that via <code>web.xml</code> an <code>&lt;error-page&gt;</code> <a href="http://wiki.apache.org/tomcat/FAQ/Miscellaneous#Q6" rel="noreferrer">can be configured</a> to customize this content.</p>
  
  <p>However, I'd just like for Tomcat to <strong>not send anything</strong> in terms of response content (I'd still like the status code, of course). Is there any way to easily configure this?</p>
  
  <p>I'm trying to avoid A) explicitly sending empty content on the response stream from my Servlet, and B) configuring custom error pages for a whole bunch of HTTP error statuses in my <code>web.xml</code>.</p>
  
  <p>For some background, I'm developing an HTTP API and am controlling my own response content. So for an HTTP 500, for example, I'm populating some XML content on the response containing error information. For situations like an HTTP 404, the HTTP response status is sufficient for clients, and the content tomcat is sending is unnecessary. If there's a different approach, I'm open to hearing it.</p>
  
  <p><strong>Edit:</strong>
  After continued investigation, I still can't find much in the way of a solution. If someone can definitively say this is not possible, or provide a resource with evidence that it will not work, I'll accept that as an answer and try and work around it.</p>