File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes servlets & XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlets & XML" Watch "servlets & XML" New topic
Author

servlets & XML

Simon Xu
Ranch Hand

Joined: Aug 16, 2000
Posts: 235
hi,

How to output a XML file from a servlet?
Thanks
Nirban Dutta
Greenhorn

Joined: Jun 20, 2001
Posts: 9
Hey,
write in the beginning response.setContenetType("text/xml");
Then,uou write the xml content inside ur servlet out.println();
where response is ur HttpServletResponse object and out is printwriter for ur response.
I think u can understand.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: servlets & XML