Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old September 13th, 2002, 08:49 AM
sgaucho sgaucho is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Posts: 26 sgaucho User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 28 sec
Reputation Power: 0
response.setContentType("text/xml")

Hi,

I am trying to ouput some xml onto my Browser (IE 6) and my code reads like this:

response.setContentType("xml");
PrintWriter out = response.getWriter();

out.print("<?xml version='1.0' encoding='ISO-8859-1'?>");
out.print("<greeting language=\"en_US\">");
out.print(" Hello, World!!!!!!!");
out.print("</greeting>");


Pretty simple u cud say.. but what happens is the servlet somehow parses the xml and prints only the values between the tags greeting!!

However if i do a view source on the browser the xml tags are visible fine!!

Any ideas why the xml tags dont appear on the browser??

thnx,
sgaucho

Reply With Quote
  #2  
Old September 14th, 2002, 09:52 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
Try "text/xml" or "application/xml" instead of just "xml" for your mime type. The problem isn't with the servlet, the problem is the browser interpreting your content as html or xhtml and trying to display the contents without the markup.

Reply With Quote
  #3  
Old September 16th, 2002, 03:46 AM
sgaucho sgaucho is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Posts: 26 sgaucho User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 28 sec
Reputation Power: 0
hi,

i originially tried with text/xml but wouldnt work either...

furtehr whats strange is that i closed the browser window and opened it again and voila the xml showed up allright but the same problem occured a few mins later!!

an more suggestion???

thnx,
sands

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > response.setContentType("text/xml")


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway