Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 47070 invoked from network); 2 Apr 2004 09:33:44 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 2 Apr 2004 09:33:44 -0000 Received: (qmail 10352 invoked by uid 500); 2 Apr 2004 09:32:57 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 10328 invoked by uid 500); 2 Apr 2004 09:32:56 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 10310 invoked from network); 2 Apr 2004 09:32:56 -0000 Received: from unknown (HELO mail500.nifty.com) (202.248.37.208) by daedalus.apache.org with SMTP; 2 Apr 2004 09:32:56 -0000 Received: from nifty.ne.jp (ntchba073207.chba.nt.ftth.ppp.infoweb.ne.jp [61.121.40.207]) (authenticated) by mail500.nifty.com with ESMTP id i329Wwxe025710 for ; Fri, 2 Apr 2004 18:32:58 +0900 Message-ID: <406D33AA.2060702@nifty.ne.jp> Date: Fri, 02 Apr 2004 18:34:34 +0900 From: Hiroshi Iwatani User-Agent: Mozilla/5.0 (compatible; MSIE 5.0; Windows 98; DigExt) X-Accept-Language: ja, en-us MIME-Version: 1.0 To: Tomcat Users List Subject: Re: JSP Include and URL encoding References: <406AB2BC.7030608@conscius.com> <20040331120632.GB13185@strange.dreamhost.com> <406AB554.6080400@conscius.com> <406BC79D.602@conscius.com> <406BD2A8.4010508@conscius.com> <406D2653.9030100@conscius.com> In-Reply-To: <406D2653.9030100@conscius.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N (1)Set page directive attributes right (Maybe, pageEncoding = your platform encoding and charset = UTF-8) (2)Use a Servlet/JSP container other than Tomcat. For example, Resin from caucho.com. Scott Ferguson wrote: > Actually, the underlying problem is a difficult one. Unfortunately, URLs > don't have an official character encoding. It looks like we're drifting > toward UTF-8 as a default, but that's not specified in the HTTP > specifications. > > Because the HTTP request does not specify the URL encoding, the web > server needs to guess. It's somewhat of an ugly problem. Today's JSPs have page directive, its contentType and pageEncoding attributes. A server doesn't need to bring rabbit out of a hat. Simply put in other words, Tomcat behavior is just substandard negligence. I have noticed that servlet generated from JSP by Resin has correct setCharacterEncoding() call even when the original JSP doesn't have the call. Resin may be called 'superstandard.' :) > That somewhat translates into the Servlet/JSP forward/include issue. > Resin's approach is to realize that the Java string for the > URL/QueryString is 16-bits, so there's no need to do any encoding until > there's a sendRedirect or something similar. > > -- Scott Dennis Thrys�e wrote: > Hi, > > I'm having problems including a JSP page from another JSP page using > parameters with special characters. > > I looked through the archives, but couldn't find anything about this issue. > > I can encode a string, and the result is correct > > URLEncoder.encode("bl�b�rgr�d", "ISO-8859-1") > > But if I make an include with the same value > > > > > > The special characters are replaced with question marks '?' (%3F). So > the query string seen from bar.jsp becomes > > word=bl%3Fb%3Frgr%3Fd > > In fact the generated java code for the main jsp file contains this > string also. So the problem is already during parsing or servlet > generation. > > The requests character encoding is null. The page directive's > pageEncoding attribute is "ISO-8859-1" (or not present - doesn't make a > difference. > > The user properties user.country and user.language are 'US' and 'en' > respectively. Might that be the cause? > > The problem is on Tomcat 4.1.29 on Linux. > > > By the way: I still haven't figured out whether Tomcat 4.1.30 is > supposed to be able to run on JDK 1.3.1. > > > Any help appreciated, > > > -dennis > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org -- Hiroshi Iwatani *stop cruelty* Annual number of institutionally euthanized cats and dogs including kittens and puppies: US 5 million, JP 500 thousand. How about your country? *for our better karma* --------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org