java ee - Send XML file as response to ajax -


i have created xml file database. xml file need send response servlet ajax. have checked various forums , blogs on web , found response xml created @ time when servlet called. in case have xml file in server, need send response ajax.

help !!

in doget() or dopost() method make sure set content-type before writing response. this...

printwriter pr = response.getwriter(); response.setcontenttype("application/xml"); //parse data xml string xml = parsexml(root); pr.write(xml); 

note: content-type of "text/xml" should valid. frameworks jquery , prototype support both.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -