DefaultServlet HttpServletResponse.setContentType called after HttpServletResponse.getOutputStream

2013-04-04 Thread Warren Crossing
In the DefaultServlet the content type is determined before the call to getOutputStream and then header is set after the call to getOutputStream, how logical is this? I think it should set the content type header before the first call to getOutputStream so that the content type is exposed to the

DefaultServlet patch

2013-04-05 Thread Warren Crossing
Here is the DefaultServlet patch which sets the content type header before getOutputstream. 872a873,879 > if (contentType != null) { > if (debug > 0) > log("DefaultServlet.serveFile: contentType='" + > contentType + "'"); > respon