actually in a servlet.. it will also work with
response.setContentType("text/xml");
at
least it does with my apps.
Environment:
Servlet 2.2 (and 2.3)
IE 5.5 sp2
-Tim
-----Original Message-----
From: Chen, Gin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 27, 2002 1:46 PM
To: [EMAIL PROTECTED]
Subject: Re: Output xml string from a servlet directly to browser and pres erve the xml structureit will.. use setheader for contenttype.. much like displaying excel spreadsheets-tim-----Original Message-----This isn't going to work in a SERVLET.
From: Richard Yee [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 27, 2002 1:44 PM
To: [EMAIL PROTECTED]
Subject: Re: Output xml string from a servlet directly to browser and pres erve the xml structure
-Richard
At 01:31 PM 3/27/2002 -0500, you wrote:
Dont use a response.setContentType
do this instead:
<%@ page contentType="text/xml;charset=ISO-8859-1" %>
then just write out the xml
example:
<%@ page contentType="text/xml;charset=ISO-8859-1" %>
<tag1>
text1
<tag2> text2 </tag2>
<tag2> text3 </tag2>
</tag1>
- -----Original Message-----
- From: Ouyang, Jian [mailto:[EMAIL PROTECTED]]
- Sent: Wednesday, March 27, 2002 12:49 PM
- To: [EMAIL PROTECTED]
- Subject: Output xml string from a servlet directly to browser and preserve the xml structure
- Hi,
- I asked for help in displaying xml in IE as it is and get little hint. Let me restate the problem.
- I want to be able to use an output method to directly output from servlet to browser an xml string with the xml tags preserved and the xml structure clearly presented. (The result should be the same as if one clicks on an .xml file).
- I tried to do response.setContentType("text/xml") before print out and didn't get what I want. (The result is the same as if I use ("text/html"), ("text/plain"));
- Some Servlet/XML Guru out there please help.
- Thanks.
- Jian
