tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e.@apache.org
Subject Re: Multi byte language problem in request.getParameter()
Date Tue, 23 May 2000 04:19:21 GMT
On Mon, 27 Mar 2000, DonS, Choi wrote:

> I have a following code
> 
> -----------------------------------------
> ..
> <script>
> function search_winner(name)
> {
>  location.href= 'e_winner.jsp?sid=' + sid + '&name=' + name;
> };
> </script>
> .....
> -----------------------------------------------------------------------
> In above sample code "name" is 2-byte lanaguage (non-ASCII)
> So tomcat should handle  URL  http://e_winner.jsp?sid=0000&name=나
> 
> In weblogic(our company uses weblogic), there is no problem.
> Weblogic can handle 2-byte lanuage in URL.
> 
> Is there any solution?

Questions like this belong on tomcat-users.

The code you've shown is quite broken -- you need to encode name when you
use it in an URL like this.  Use the output of
java.net.URLEncoder.encode(name) -- instead of name -- and you should be
fine.

I don't know enough about the internals of WebLogic to speculate as to why
it may work in that environment -- but this code should be fixed in any
case.  FWIW -- you might also want to apply response.encodeUrl to the
whole url, so as to allow sessions to work when users turn off cookies.

Ed






Mime
View raw message