tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Ludwig <mil...@gmx.de>
Subject Re: Odd encoding of servlet parameters
Date Thu, 27 Nov 2008 22:02:25 GMT
Chris Mannion schrieb am 27.11.2008 um 10:17:43 (+0000):
> 
> The servlet in question accepts XML data that is posted to it as a URL
> parameter called 'xml'.

"Posted as a URL parameter"? POST or GET? You want a POST here.

> &lt;xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
>   &lt;records&gt;
>     &lt;record&gt;

That's XML as a string, as if intended for inclusion in XML. Markup is
parsed as a string, hence the entity references.

http://www.w3.org/TR/REC-xml/#sec-predefined-ent

> Before sending the XML is encoded using the java.net.URLEncoder object
> and the UTF-8 character set, but using a java.net.URLDecoder on
> receiving it does not get rid of the encoded characters.

Nothing to do with URL encoding, which looks different.

Nothing to do with the character encoding. (Note that all escaped
characters are in the ASCII character set.)

Some element in the chain gets the parsing wrong. I'd suspect the
producer of this "XML" first.

Michael Ludwig

---------------------------------------------------------------------
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