use java.net.URLEncoder to encode XML String

>  -----Original Message-----
> From:         Bo Min Jiang [mailto:[EMAIL PROTECTED]] 
> Sent: Saturday, June 01, 2002 11:47 AM
> To:   Tomcat Users List
> Subject:      getParameters in  HTTPServletRequest returns wrong result
> with XML body
> 
> Hi,
> 
> I working on an app that passes a XML string through a HTTP form post to a
> Servlet.  The string looks something like this:
> 
> xmldocument=<?xml version="1.0" encoding="UTF-8"?> <AdvancedSearch>
> <SearchExpression searchItem ="product"> <Expression field="category"
> operator="EQ"
> value="tires"></Expression></SearchExpression></SearchExpression></Advance
> dSearch>
> 
> 
> When I call getParameters on HTTPServletRequest, I expect to get the
> following name-value pair:
> 
> name: xmldocument
> value: <?xml version="1.0" encoding="UTF-8"?> <AdvancedSearch>
> <SearchExpression searchItem ="product"> <Expression field="category"
> operator="EQ"
> value="tires"></Expression></SearchExpression></SearchExpression></Advance
> dSearch>
> 
> However, I get the following name-value pair back:
> 
> name: "EQ" value
> value:
> "tires"></Expression></SearchExpression></SearchExpression></AdvancedSearc
> h>
> 
> From this, I have a few questions:
> 
> *     Why does this happen?  Is there a problem in the encoding of the
> XML?  The content type being used is "application/x-www-form-urlencoded"
> *     How does Tomcat go about getting parameters from the message body?
> Does it start from the end of the string?
> 
> Also, I ran my app through JRun and got the correct results.  Any help
> would be greatly appreciated.
> 
> Thanks,
> Bo
>  << File: ATT00009.txt >> 

Attachment: winmail.dat
Description: application/ms-tnef

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to