This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Wrting XML in Servlet  RSS feed

 
Vikas
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

I have a task to write an XML document in a Servlet file and sending it to the JSP. Can any one suggest how to proceed in this regards??

Thank you
Vikas
 
Chris Stehno
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could generate the xml as a string or strings inside the servlet and set the content type to "text/xml" or you could build a Document object and put it in the request forwarded to the JSP page (setAttribute()) and then use the Document object directly in the JSP page.

Hope this helps.
 
Vikas
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Chris. I am already implementing the way you suggested. My requirement is that I want to send an xml file abc.xml at client end to enable the AJAX so that the created xml files stays at the system of end user and and he/she doesn't need to hit the server again and again.

Regards
Vikas Sharda
 
Vikas
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

Can anybody suggest me as to which approach his better one?? Is it the one that is suggested by Chris or having an XML document at end user location seperately??

Thank you
Regards
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!