I dont think that code will work in any situation, I might be wrong though.
It looks a bit dangerous at least, and a bit hard to apply everywhere.

But I have found a bulletproof solution for this (the only solution I think).

I used to have this working in tomcat 4.
I had a encoding filter applied in front of the servlet, setting the
request.setCharacterEncoding("UTF-8") before anything had accessed the request 
input stream.

This just stopped working suddenly when upgrading to tomcat 5.0.26.
It seems that they had removed the request.setCharacterEncoding support, and 
had applied something to the Connector element in server.xml of tomcat.

My Connector now looks like this in conf/server.xml
<Connector port="80" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
  |                enableLookups="false" redirectPort="8443" acceptCount="100"
  |                debug="0" connectionTimeout="20000" URIEncoding="UTF-8"
  |                disableUploadTimeout="true" />

Look at URIEncoding="UTF-8"..

request.getParameter("word") will now give me the UTF-8 decoded string.
You need then to make sure that each url in <a href is properly encoded.
I think form submit will be correctly encoded in utf-8 if the meta tag says the 
page is in utf-8, at least that is what I see in firefox and IE.

Thanks
Magne



View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3857461#3857461

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3857461


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to