133fa70c by Ean Schuessler

Merge branch 'BF-8478' into 'master'

#8478 Add a new option for returning HTML

See merge request !1
2 parents e2475825 ac02c978
...@@ -492,6 +492,18 @@ public class DirectControlServlet extends HttpServlet { ...@@ -492,6 +492,18 @@ public class DirectControlServlet extends HttpServlet {
492 492
493 setResponseNoCache(); 493 setResponseNoCache();
494 494
495 if ("HTML".equals(outputHandler)) {
496 response.setContentType("text/html; charset=utf-8");
497
498 PrintWriter writer = response.getWriter();
499
500 String jsonStr = JSON.from(result).toString();
501 response.setContentLength(jsonStr.getBytes("UTF-8").length);
502 writer.write(jsonStr);
503 writer.flush();
504 writer.close();
505 }
506
495 if ("JSON".equals(outputHandler)) { 507 if ("JSON".equals(outputHandler)) {
496 response.setContentType("application/x-json;charset=UTF-8"); 508 response.setContentType("application/x-json;charset=UTF-8");
497 509
......