try setting the content type as

response.setContentType("text/xml; charset=UTF-8" );

Vijay Naidu
-----------------------------------------------------------------

Smile Is A Curve That Makes Everything Straight. Keep Smiling
-----------------------------------------------------------------
From: "Ouyang, Jian" <[EMAIL PROTECTED]>
Reply-To: "A mailing list for discussion about Sun Microsystem's Java Servlet API Technology." <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: Output xml string from a servlet directly to browser and pres erve the xml structure
Date: Wed, 27 Mar 2002 13:17:22 -0500
Nic,
If I have xml string:
text1
text2
text3
I want to display it as it shown in the browser. But if I output this xml
string to the browser, I will get:
text1text2text3
Is this clear to you? Please help. Thanks.
Jian
-----Original Message-----
From: Nic Ferrier [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 27, 2002 1:00 PM
To: [EMAIL PROTECTED]
Subject: Re: Output xml string from a servlet directly to browser and
preserve the xml structure
"Ouyang, Jian" <[EMAIL PROTECTED]>writes:
> 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'm not sure what you mean by xml tags preserved. IE does some
strange things with XML, it tries to display the document as a DOM.
But I'm not sure if that's the behaviour you're after...
> 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"));
If you specified the content type as text/plain you'd get just the
plain text of the XML but I presume that's not what you want.
Nic Ferrier
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html


Send and receive Hotmail on your mobile device: Click Here
___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to