private String buildJsonResult(Object result) { StringBuilder sb = new StringBuilder(); sb.append("<script type=\"application/javascript\">") .append("\nreplace(\"") .append(pipeProxy.getKey()) .append("\",\'") .append(result.toString().replaceAll("\n", "")) .append("\');\n</script>"); return sb.toString(); }
@Override public void run() { Object result = syncPipeExecutor.execute(pipeProxy); // 构造script输出 renderResult.put(pipeProxy.getKey(), buildJsonResult(result)); }