tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: URIEncoding
Date Thu, 26 Jul 2007 19:16:17 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Frederic,

Frederic Bastian wrote:
> The point is that I need to use the java.net.URLEncoder.encode() method,
> e.g. java.net.URLEncoder.encode(myParam, "UTF-8").

You ought to be using the response's character encoding, not whatever
Tomcat (or the browser) is using for URIEncoding.

You want to do this:

java.net.URLEncoder.encode(myParam, request.getCharacterEncoding());

Or, you could do what everybody else in the world does and use a tag
library or some other tool to emit URLs including parameters, etc.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGqPMB9CaO5/Lv0PARAiyhAJ4zYvszzqRzArWTfHxMIIWN3sU5aQCfRlBs
g5X8A0Fh88S5Mrmii+Ylg8g=
=y7Mj
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message