Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to open an XML response in a browser?

 
Max Tomlinson
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi-
I have a jsp which returns an well-formed xml response as a string.
I want to have the browser open it as a doc so the user can view it.
Can someone please tell me how to do this?
thanks
Max
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35757
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Max,
If the user's browser supports XML, all you have to do is set the MIME type on your response header. If the user's browser does not support the XML type, there is no way to display XML in browser (unless you return it in preformatted text in HTML.)

In other words, you can suggest the XML be displayed, but not guarantee it.
 
Max Tomlinson
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne-
Thanks for the response -
works perfectly
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!