我将net.sf.json用于JSONObject。 json对象中的null值不等于Java null。使用<c:if test='${not empty obj.value}'>不起作用。有什么方法可以比较JSTL标记中的JSON空值。
<c:if test='${not empty obj.value}'>
执行以下操作:
<c:if test='${JSONObject.NULL eq obj.value}'>
您需要将net.sf.json.JSONObject导入您的JSP。
net.sf.json.JSONObject