我有来自servlet session.setAttribute("leavesJson", leavesJson);
的这个JSON字符串,现在我正在尝试在JSP页面上打印它。
JSON字符串:
{"7:[{"ID":7,"Req":6,
"Type":1,"dataAi":null,"dataA":null,"dataR":null,"nrZ":null}],
"8":[{"ID":8,"Req":11,"Type":2,"dataA":null,"dataAi":null,"dataR":null,"nrZ":null}]}
在JSP页面中我有这个:
<c:set var="leavesJson" value="leavesJsonForTL"/>
<c:if test="${empty leavesJsonForTL.leavesTeam}">
<c:out value="${leavesJson}"/>
<c:forEach begin="0" end="${leavesJson.length() -1}" var="leavesJsonForTL">
//what should I put here?
</c:forEach>
</c:if>
我想打印JSON中的所有细节,但实际上并不知道如何继续。如何从字符串中访问该元素?