Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@www.apache.org Received: (qmail 22758 invoked from network); 28 Jul 2004 17:05:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 28 Jul 2004 17:05:51 -0000 Received: (qmail 30191 invoked by uid 500); 28 Jul 2004 17:05:38 -0000 Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 30091 invoked by uid 500); 28 Jul 2004 17:05:36 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 30071 invoked by uid 99); 28 Jul 2004 17:05:36 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.18.42.14] (HELO nwkea-mail-2.sun.com) (192.18.42.14) by apache.org (qpsmtpd/0.27.1) with ESMTP; Wed, 28 Jul 2004 10:05:35 -0700 Received: from phys-d3-ha21sca-1 ([129.145.155.163]) by nwkea-mail-2.sun.com (8.12.10/8.12.9) with ESMTP id i6SH5W0R003651 for ; Wed, 28 Jul 2004 10:05:32 -0700 (PDT) Received: from conversion-daemon.ha21sca-mail1.sfbay.sun.com by ha21sca-mail1.sfbay.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) id <0I1K00D01NF35S@ha21sca-mail1.sfbay.sun.com> (original mail from Jan.Luehe@Sun.COM) for tomcat-dev@jakarta.apache.org; Wed, 28 Jul 2004 10:05:32 -0700 (PDT) Received: from sun.com (raga2.SFBay.Sun.COM [129.145.132.30]) by ha21sca-mail1.sfbay.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) with ESMTP id <0I1K0046TNH8K2@ha21sca-mail1.sfbay.sun.com> for tomcat-dev@jakarta.apache.org; Wed, 28 Jul 2004 10:05:32 -0700 (PDT) Date: Wed, 28 Jul 2004 10:05:32 -0700 From: Jan Luehe Subject: Re: cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Http11Processor.java In-reply-to: <410778F2.7020701@apache.org> To: Tomcat Developers List Reply-to: Jan.Luehe@Sun.COM Message-id: <4107DCDC.7080707@sun.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-US User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.4) Gecko/20040414 References: <20040728004344.62042.qmail@minotaur.apache.org> <41077297.8090507@apache.org> <410778F2.7020701@apache.org> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Remy, Remy Maucherat wrote: > Remy Maucherat wrote: > >> Cool. So after all the efforts I'm doing to optimize, you casually add >> GC, because the servlet API is completely stupid ? >> So -1 for your patch: you need to rework it. I also didn't read all >> that funny stuff in the specification, so where does it come from ? ;) > > > I thought about it some more, and in addition to the performance > problem, it would lead to adding charset even for binaries. We already > found out that this way very bad (in addition to being meaningless, it > breaks some clients such as Acrobat which simply does a check on the > MIME type without removing the charset, which is rather logical since > they're dealing with binaries) - this was some unintended behavior in > some 4.1.x release (if I remember well, it was introduced by you > already: you do like charset related issues ;) ). yes, sorry, I had forgotten about that case. Believe, I didn't commit yesterday's patch simply because I don't have anything better to do. It's come up as a compliance issue which had been masked by an unrelated problem that was fixed. > So what I suggest is that you send that you send that as feedback to the > servlet API, and that they put a small errata for the specification. > -1 for implementing the requirements of the specificatrion (although I > can't find them anywhere ;) ) to the letter right now, as they are > broken (I didn't dislike the previous behavior, so I want it to remain). ServletResponse.setCharacterEncoding/setContentType/setLocale... *

Containers must communicate the character encoding used for * the servlet response's writer to the client if the protocol * provides a way for doing so. In the case of HTTP, the character * encoding is communicated as part of the Content-Type * header for text media types. Note that the character encoding * cannot be communicated via HTTP headers if the servlet does not * specify a content type; however, it is still used to encode text * written via the servlet response's writer. Reason: Many browsers let the user choose which encoding to apply to responses that don't declare their encoding, which will result in data corruption if the response was encoded in ISO-8859-1 and the user picks an incompatible encoding. ServletResponse.getContentType...: * If no character encoding has been specified, the * charset parameter is omitted. Reason: Allow setLocale() to set the response's char encoding (corresponding to the locale) if the char encoding has not already been set by setContentType() or setCharacterEncoding(). You can find corresponding wordings in the servlet spec. Therefore, we need to add a charset to the Content-Type response header if: - no response encoding has been specified (ie., the return value of ServletResponse.getContentType() has no charset), and - the response is using a writer My patch did not check for the latter. Jan --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org