4 Replies Latest reply on Sep 5, 2002 9:08 PM by ipozeng

    return xml data from a servlet ?

    ipozeng

      Hi,friends,
      As i know the servlet will return html to client. How can i embed xml data into html ? and how can the client fetch those xml data?
      I ever heard if xml island however i am not sure about it :(
      please give me any suggestion.

      Thanks in advance !

        • 1. Re: return xml data from a servlet ?
          gorazdh

          Servlet will return whatever you'll program it to return. Normally it would be a HTML, but there is no restriction on that. All you have to do is to change the "Content-Type" header from "text/html" to "text/xml" and then return a formatted XML response. The same goes with all other formats (.zip, .doc, ...)

          • 2. Re: return xml data from a servlet ?
            joelvogt

            You might want to look at XSLT for displaying your xml

            • 3. Re: return xml data from a servlet ?
              ipozeng

              thank you !
              Now i will test using delphi to call the servlet which returns xml data .And the xml data will be populated into a TClientDataSet.

              regards!

              • 4. Re: return xml data from a servlet ?
                ipozeng

                Now i have successfully gotten XML data from servlet according to your suggestion,setting the contentType to text/xml.
                However i donot know how to send XML to servlet ? Do i need to base64-encoding the XML data? If yes,please tell me how to do it ? Because i am not very familiar with base64 :(

                Best Regards!