• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Wrting XML in Servlet

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic