Posted By:
danny_rebello
Posted On:
Thursday, July 27, 2006 04:11 AM
Hi All, I am trying to pass xml data from servlet in my jsp with Ajax request and response and through javascript writing the data in the xml tags in my jsp Based on certain parameters , the records are displayed If records are present , the records dipslayed in the request.responseText of Ajax, but when no records are present then too, the request.responseText displays the records and the records on the Jsp Page are stil displayed. I have called the response.reset method , of the Servlet but still no solution SERVLET CODE : StringBuffer xml = new StringBuffer(); xml.append(" <?xml version="1.0"?>
More>>
Hi All,
I am trying to pass xml data from servlet in my jsp with Ajax request and
response and through javascript writing the data in the xml tags in my jsp
Based on certain parameters , the records are displayed
If records are present , the records dipslayed in the
request.responseText of Ajax, but when no records are present then too,
the request.responseText displays the records and the records on the
Jsp Page are stil displayed. I have called the response.reset method ,
of the Servlet but still no solution
SERVLET CODE :
StringBuffer xml = new StringBuffer();
xml.append("
<?xml version="1.0"?>
");
String st = "123234425";
xml.append("
");
LOTS OF XML CODE BEING WRITTEN HERE
xml.append("
");
String xmlFormat = xml.toString();
response.reset();
response.setContentType("application/xml");
response.getWriter().write(xmlFormat);
Thanks in advance
Danny Rebello
<<Less