try {
this.response.setContentType("text/html");
JsonParser jsonParser = DirectContext.get().getConfiguration().getParser();
PrintWriter writer = this.response.getWriter();
writer.write("<html><body><textarea>");
jsonParser.format(events, writer);
writer.write("</textarea></body></html>");
} catch(IOException e) {
throw new DirectException(e);
}
}