tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frederic Bastian <>
Subject Re: URIEncoding
Date Thu, 26 Jul 2007 13:25:37 GMT
Hi Pulkit, thanks for your answer.

The matter is that Tomcat won't get the correct values of the parameters 
in the URL. For instance :

If my URI looks like : http://host/?query=%C3%A9%C3%A8
The URI encoding is UTF-8

By default, Tomcat will read this url in ISO-8859-1. So 
HttpServletRequest.getParameter("query") will return an incorrect value.
The solution you proposed won't help Tomcat to return a correct value 
with the "getParameter" method.

If I add into server.xml the attribut URIEncoding="UTF-8" to the 
Connector, Tomcat will correctly read the "query" parameter.
I would like Tomcat to read correctly URL in UTF-8, but without 
modifying server.xml.

Any suggestion ?

Pulkit Singhal a écrit :
> Hi Frederic,
> I don't know about HttpSession.<method> for settign the URIEncoding.
> But you could always do somethign along the lines of:
> String uri_utf8 = new String (uri.getBytes("iso-8859-1"), "UTF-8");
> inside the application.
> On 7/26/07, Frederic Bastian <> wrote:
>> Hi folks :)
>> I need my URI to be in UTF-8. In server.xml, I added to the Connector
>> the attribut : URIEncoding="UTF-8"
>> This works well. But my question is :
>> Is there a way to define the URIEncoding in the application itself ?
>> For instance, you can modify the session timeout in the application
>> itself (HttpSession.setMaxInactiveInterval()). I would like to modify
>> the URIEncoding by the same way.
>> Would anyone know how to achieve that ?
>> Thanks.
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail:
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:

Frederic Bastian, PhD student
Department of Ecology and Evolution
Biophore, University of Lausanne, 1015 Lausanne, Switzerland.
tel: +41 21 692 4221

Swiss Institute of Bioinformatics 

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message