tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <>
Subject Re: DefaultServlet HttpServletResponse.setContentType called after HttpServletResponse.getOutputStream
Date Mon, 08 Apr 2013 13:54:18 GMT
On 04/04/2013 23:43, Warren Crossing wrote:
> 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 outputstream filters.

The content type can be set at any point up to when the response is 
committed. Anything that depends on content type needs to be able to 
handle changes in content type up to the point where the response is 
committed. Therefore I am against this change as it is unnecessary.


> Additionally, as a side note I see there is XSLT for directory listings,
> I propose that listings get a
> <?xml-stylesheet href="resource:/listing.xslt" type="text/xsl"?>
> processing instruction and then served by the caching translet caching
> filter which will be much faster, I will submit this under ASF2 if there
> is interest?

Sounds good but could you provide a reference please. Google shows no 
results for "caching translet caching filter".


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message