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

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -