If I use the xmlhttp object provided by Microsoft to send an XML document to a JSP from within an HTML page, how do I consume the XML passed?

Serge Knystautas

Have your JSP or servlet call request.getInputStream() to get the ServletInputStream, which is how you can retrieve data sent via a POST. Do not call request.getParameter() as the servlet engine will attempt to parse the XML as a standard form parameter and can corrupt the inputstream.

You can then take your XML parser and parse the ServletInputStream as an XML fragment as you would any other inputstream (either using SAX or DOM parsing).

Note that Microsoft does not support using this component for sending or receiving XML remotely (which it seems is this usage scenario). http://support.microsoft.com/support/kb/articles/q237/9/06.asp?LNG=ENG&SA=ALLKB

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact