jsonPreview.jsp
1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<%@ page import="com.api.integration.util.JsonFormatTool" %><%--
JSON预览
Created by IntelliJ IDEA.
User: SJZ
Date: 2018/1/2
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea" %>
<%
String json = Util.null2String(request.getParameter("json"));
JsonFormatTool jsonFormat = new JsonFormatTool();
json = jsonFormat.formatJson(json);
%>
<html>
<script src="/integration/js/codemirror/lib/codemirror_wev8.js"></script>
<script src="/integration/js/codemirror/mode/javascript/javascript_wev8.js"></script>
<link rel="stylesheet" href="/integration/js/codemirror/lib/codemirror_wev8.css"/>
<link rel="stylesheet" href="/integration/js/codemirror/theme/eclipse_wev8.css"/>
<body>
<div class="zDialog_div_content">
<wea:layout>
<wea:group context='JSON'
attributes="{'samePair':'SetInfo','groupOperDisplay':'none','itemAreaDisplay':'block'}">
<wea:item attributes="{'colspan':'2','isTableList':'true'}">
<div>
<textarea id="jsonCode" name="jsonCode"><%=json%></textarea>
</div>
</wea:item>
</wea:group>
</wea:layout>
</div>
</body>
</html>
<script>
var editor;
jQuery(document).ready(function () {
editor = CodeMirror.fromTextArea(document.getElementById("jsonCode"), {
lineNumbers: true,
theme: "eclipse",
indentUnit: 4,
mode: "text/javascript"
});
});
</script>