struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Gordon <>
Subject Re: Struts 1.2.9 and UNICODE issue on form submittal
Date Fri, 01 Jun 2007 16:41:07 GMT
You know, I had my doubts about whether or not Struts was really 
actually doing anything with POST request parameters other than just 
reading them.  It did seem to me that it was more of an issue at the 
Tomcat level since Tomcat is the one serving up the parameters.

After some digging, there's  URIEncoding attribute on the Connector 
element that if not specified defaults to ISO-8859-1 when attempting to 
decode URI bytes.  I suspect setting this to UTF-8, in addition to the 
other changes we made (the @page directive and <meta> tag directive for 
the Content-Type, and the acceptCharset attribute on html:form all to 
UTF-8) will fix the problem...we'll see.

After reading some of the developer comments in the filed bugs, UTF-8 
appears to be the only standard on URL encoding, however according to 
them in 2003, no one really paid attention it - hopefully this is not 
the case anymore.

Thanks for the reference links.


Niall Pemberton wrote:
> Struts doesn't do anything with the encoding - I imagine if you
> accessed the parameter value directly from the request you will see
> the same issue. You could try setting the encoding on the request
> using the setCharacterEncoding("UTF-8") - but you need to do that
> before the request is processed - (either in the request processor in
> Struts 1.2.x or inserting a Command into the chain for 1.3.x)
> If that doesn't work then I would look at the Servlet Container you're
> using - for example Tomcat has the following FAQ:
> Niall

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message