• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

maintain the format of xml message on browser

 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have xml message stored into database and I am displaying that message on my browser through jsp file. But when it comes on browser, the format of the xml gets completely changed. how to preserve the original xml content ? any idea ?
 
Marshal
Posts: 26092
71
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could we have some description about what "completely changed" means? Right now it's impossible to tell what you are asking.
 
jazy smith
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,

If the xml in db has format shown below then,



printing the same thing onto browswer, says,

 
Paul Clapham
Marshal
Posts: 26092
71
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, so all of the tags are disappearing. That would be normal if you had told the browser it was an HTML document. Which you probably did, if you used a JSP to output that document. Is the content type set to text/html?
 
jazy smith
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for prompt reply.

That would be normal if you had told the browser it was an HTML document. Which you probably did, if you used a JSP to output that document. Is the content type set to text/html?


Didn't get you Paul. Please explain li'l bit more.

thanks
 
jazy smith
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, content-type is "text/html" . Is that the issue ? if yes, what should I do ?
 
jazy smith
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
let me try using"text/xml"
 
Paul Clapham
Marshal
Posts: 26092
71
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

jazy smith wrote:Yes, content-type is "text/html" . Is that the issue ? if yes, what should I do ?



Start by not using a JSP to output the document. Just copy it to the response from a servlet and set the content type correctly.
 
jazy smith
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so you want me to change the result.jsp to result.html and the content as "text/xml" ?
 
jazy smith
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,

I have to use result.jsp to output the content of db into tabular format. If I make change in you think am I doing right ?
 
jazy smith
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,

It didn't work. Please let me know what should I do if i want this jsp page to display xml format ?
 
Morning came much too soon and it brought along a friend named Margarita Hangover, and a tiny ad.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic