我正在遍历我的地图:
我将地图放在控制器模型属性中,例如:
model.addAttribute("myMap", realMapObject);
JSP 代码:
<c:forEach items="${myMap}" var="entry">
..... works perfectly iteration itself
.....
我需要检查另一个地图( )myMap
中是否存在入口键。anotherMap
我试过这个:
model.addAttribute("anotherMap", realMapObjectAnotherMap);
JSP 代码:
<c:forEach items="${myMap}" var="entry">
.....
.....works perfectly
<c:choose>
<c:when test="${not empty ${anotherMap['${entry.key}']}}">
<h2>${entry.key} - YES</h2>
</c:when>
<c:otherwise>
<h2>${entry.key} - NOT</h2>
</c:otherwise>
</c:choose>
我收到此错误:
包含无效表达式:javax.el.ELException:错误解析: