I'm trying to output an XmlDocument from the HttpServlet's response object to another servlet.

Gene De Lisa

Try setting the content type for the response object.

response.setContentType("text/html");
Here is the second part.
try {
    Writer out = new OutputStreamWriter(os);
    doc.getDocumentElement().normalize();
    doc.write(out);
    out.write("
");
    out.flush();
} catch(IOException e) {
    System.err.println(e);
}
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact