By default, Tomcat sends some HTML content back to the client if it encounters something like an HTTP 404. I know that via web.xml an
Although it's Servlet spec compliant, for security reasons I don't want tomcat or any other Servlet container to send error details. I struggled with this as well a bit. After searching and trying, the solution can be summed up as:
sendError(), use setStatus() instead sendError() though... sendError() to setStatus()A little example servlet filter doing this can be found here.