case json: return new Response(http_code, MIME_JSON, new String(s.writeJSON(new AutoBuffer()).buf()));
case xml: //return new Response(http_code, MIME_XML , new String(S.writeXML (new AutoBuffer()).buf()));
case java:
throw H2O.unimpl();
case html: {
RString html = new RString(_htmlTemplate);
html.replace("CONTENTS", s.writeHTML(new water.util.DocGen.HTML()).toString());
return new Response(http_code, MIME_HTML, html.toString());
}
default:
throw H2O.fail();
}
}