| Author |
How to display XML documents using JSP?
|
Rudy Rusli
Ranch Hand
Joined: Jun 01, 2006
Posts: 114
|
|
I'm trying to provide data to clients by providing them a URL to my jsp page. The JSP page will get all the data from a table in database and display the data as an xml. The data created okay and client's program can access it fine. The problem is when I try to open the JSP page in the browser, it doesn't look like XML at all. I think it's because the "open" and "close" tag in XML documents. How could I handle this so people can view the data in their browser? Thanks in advance for the advice. - Rudy -
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56185
|
|
XML isn't a display format, so it's not clear at all what you mean by "display the XML". What is it you are trying to show them?
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56185
|
|
|
Are you setting the content type to "text/xml"?
|
 |
Rudy Rusli
Ranch Hand
Joined: Jun 01, 2006
Posts: 114
|
|
I'm trying to display data from a table in DB and display it in XML format so the jsp page should print out something like: How can i set the content type to text/xml? Thanks for the help. - Rudy -
|
 |
Adeel Ansari
Ranch Hand
Joined: Aug 15, 2004
Posts: 2874
|
|
|
For this you can create an XML file and make a link to that. Browser will show it as it would be.
|
 |
 |
|
|
subject: How to display XML documents using JSP?
|
|
|