| Author |
Wrting XML in Servlet
|
Vikas
Ranch Hand
Joined: Dec 16, 2004
Posts: 63
|
|
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
Joined: Feb 26, 2001
Posts: 180
|
|
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.
|
- Chris Stehno, SCPJ
|
 |
Vikas
Ranch Hand
Joined: Dec 16, 2004
Posts: 63
|
|
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
Joined: Dec 16, 2004
Posts: 63
|
|
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
|
 |
 |
|
|
subject: Wrting XML in Servlet
|
|
|