tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Wong <rw...@opsware.com>
Subject Re: How do I configure Tomcat to translate UTF-8 encoded parameters
Date Tue, 24 Aug 2004 03:34:37 GMT
Filip Hanik (lists) wrote:

>doesn't URIEncoding suggest that the URI is encoded, 
>in a POST, the parameters are passed in the body, not in the URI?
>
>  
>
Yes it does, and hence the second part of my question.  Do you know how 
one can configure Tomcat to decode input parameters with UTF-8 encoding?

--
Rick

>
>-----Original Message-----
>From: Rick Wong [mailto:rwong@opsware.com]
>Sent: Monday, August 23, 2004 8:08 PM
>To: Tomcat Users List
>Subject: How do I configure Tomcat to translate UTF-8 encoded parameters
>
>
>Hi,
>
>I am using Tomcat 5.0.26.  I configured the HTTP connector to decode URI 
>with setting URIEncoding="UTF-8"
>
>      <Connector port="8080" address="${jboss.bind.address}"
>         maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
>         enableLookups="false" redirectPort="8443" acceptCount="100"
>         URIEncoding="UTF-8"
>         connectionTimeout="20000" disableUploadTimeout="true"/>
>
>This works for my pages that accept HTTP GET request.  Unicode input 
>parameter values that are UTF-8 encoded are properly decoded when 
>calling request.getParameter().  However, if the request is HTTP POST, 
>the input parameter values are mangled.  Am I missing some configuration 
>settings?
>
>I have the following simple JSP page to illustrate the problem.
>
><%@ page contentType="text/html;charset=UTF-8" %>
><html>
><head>
><title>Testing UTF-8</title>
><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
></head>
><body>
>
>Type in UNICODE characters in input field and click the Submit button.
>
><h1>Testing UTF-8 using GET</h1>
><form action="<%=request.getRequestURI()%>" method="GET">
><input type="text" name="data" value='<%=request.getParameter("data")%>'/>
><input type="submit" name="submit" value="submit"/>
></form>
>
><h1>Testing UTF-8 using POST</h1>
><form action="<%=request.getRequestURI()%>" method="POST">
><input type="text" name="data" value='<%=request.getParameter("data")%>'/>
><input type="submit" name="submit" value="submit"/>
></form>
>
></body>
></html>
>
>
>--
>Rick
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.740 / Virus Database: 494 - Release Date: 8/16/2004
>
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.740 / Virus Database: 494 - Release Date: 8/16/2004
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message