i have created a xml file from database.
this xml file i need to send as a response from my servlet to ajax.
I have checked various forums and blogs over the web and found that the response xml is created at the time when the servlet is called.
In this case i already have a xml file in my server, i just need to send it as a response to ajax.
Help !!
In your doGet() or doPost() method make sure you set the content-type before writing anything to the response. Like this…
Note: A content-type of
"text/xml"should also be valid. Frameworks like JQuery and Prototype support both.