package eu.etaxonomy.cdm.remote.view;
+import java.io.BufferedWriter;
import java.io.OutputStream;
+import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Map;
return "text/xml";
}
- public void render(Map model, HttpServletRequest request, HttpServletResponse response) throws Exception {
-
+ public void render(Map model, HttpServletRequest request, HttpServletResponse response) throws Exception {
// Retrieve data from model
- Object dto = model.get("dto");
-
+ Object dto = model.values().toArray()[0];
// Write the XML document to the reponse output stream
- OutputStream out = response.getOutputStream();
XppDriver xpp = new XppDriver();
XStream xstream = new XStream(xpp);
/*
* */
xstream.setMode(XStream.NO_REFERENCES);
// serialize DTO into XML
- xstream.toXML(dto,out);
+ Writer out = new BufferedWriter(new OutputStreamWriter(response.getOutputStream()));
+ xstream.toXML(dto, out);
+
}
}
\ No newline at end of file