tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Koop <gro...@timkoop.com>
Subject Re: Request parameter data not being recognised as UTF-8
Date Fri, 22 Jul 2005 14:04:39 GMT
Thanks Mark.

I entered "Tübingen" and I got back "Data posted to this form was: 
Tübingen".  localhost_log also has "Tübingen"

It does this for both port 8080 (Tomcat directly), and port 80 (through 
Apache).

I checked the Tomcat 4.1.31 release notes 
(http://apache.sunsite.ualberta.ca/jakarta/tomcat-4/v4.1.31/RELEASE-NOTES) 
and the closest thing I could find is the following, which is only 
documentation.

[4.1.31] Docs:
         Correctly document default value for useBodyEncodingForURI

I modified the simple jsp page to have these lines:
    <%
      out.print("Char endoding = " + request.getCharacterEncoding() + "<p>");
      request.setCharacterEncoding("utf-8");
      out.print("Data posted to this form was: " + request.getParameter("mydata") + "<p>");
      out.print("Char endoding = " + request.getCharacterEncoding() + "<p>");
    %>

The response was:

Char endoding = null

Data posted to this form was: Tübingen

Char endoding = utf-8


Should I have something in my web.xml file?  Is there some way to verify 
that what I enter in the Connector tag in server.xml is actually 
sticking?  I couldn't find any errors in localhost.log nor in 
cataline.out (well, no relavent errors at least).

Thanks a lot, to anyone who has any ideas.

--
Tim Koop




Mark Thomas wrote:

>
> 1. Try accessing Tomcat directly to see if mod_jk is causing problems.
> 2. Try 4.1.31 - it has a bunch of bug fixes that might (I haven't 
> checked the release note for details) help
> 3. Try the following simple test JSP and once this works, see how your 
> app is different.
>
> <%@ page contentType="text/html; charset=UTF-8" %>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
>   <head>
>     <title>Encoding fun</title>
>   </head>
>   <body>
>     <p>Data posted to this form was:
>     <%
>       request.setCharacterEncoding("UTF-8");
>       out.print(request.getParameter("mydata"));
>     %>
>
>     </p>
>     <form method="post" action="index.jsp"
>           enctype="application/x-www-form-urlencoded">
>       <input type="text" name="mydata">
>       <input type="submit" value="Submit" />
>       <input type="reset" value="Reset" />
>     </form>
>   </body>
> </html>
>
> Mark
>
>
> ---------------------------------------------------------------------
> 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