/** JaggeryMethod responsible of writing to the output stream */ public static void print(Context cx, Scriptable thisObj, Object[] args, Function funObj) throws ScriptException { if (!isWebSocket) { JaggeryContext jaggeryContext = CommonManager.getJaggeryContext(); // If the script itself havent set the content type we set the default content type to be // text/html HttpServletResponse servletResponse = (HttpServletResponse) jaggeryContext.getProperty(SERVLET_RESPONSE); if (servletResponse.getContentType() == null) { servletResponse.setContentType(DEFAULT_CONTENT_TYPE); } if (servletResponse.getCharacterEncoding() == null) { servletResponse.setCharacterEncoding(DEFAULT_CHAR_ENCODING); } CommonManager.print(cx, thisObj, args, funObj); } }