DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10541>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10541 Content-length header should be automatically set for buffered Servlets/JSPs Summary: Content-length header should be automatically set for buffered Servlets/JSPs Product: Tomcat 4 Version: 4.0.4 Final Platform: PC OS/Version: All Status: NEW Severity: Normal Priority: Other Component: Servlet & JSP API AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] The Servlet 2.3 API spec on pages 186 (bottom) and 189 (top) states that if a Servlet (and therefore a JSP also) is using a buffer and does not fill up the buffer, (and is not using Chunked transfer encoding) the container should automatically set the content-length header if the servlet itself doesn't do it. This is really more important for JSP's, since custom Servlet's generally set the content length themselves and don't call response.setBuffer(size) anyway. JSP's on the other hand, are buffered by default (according to spec) and really benefit from having the container set the content length header for them because they basically never bother to do this themselves. And the reason (in case you need one) that having the content length header set is important is that it effects performance. Web browsers, giving a content length, can handle the response more efficently, and the server can also use persistent connections (keep-alive), which is impossible w/o content length headers. So from my testing, Tomcat 4.0.4 doesn't ever set the content length header automaticaly -- actually I should say I've tested a lot more with JSP's than plain Servlets, but I assume the piece of code that would do this is shared by both. Thanks. -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>