我有以下数组:
List<HashMap<String, String>> array = new ArrayList<HashMap<String, String>>();
[{name=BIRTH_DATE}, {catVal=07.11.2011}, {catStat=162}, {catVal=30.04.2011}, {catStat=108}, {CatVal=26.01.2011}]
我想使用 JSTL 在名称、catVal 和 CatStat 之间进行选择。我尝试了以下方法,但它不起作用。我怎样才能得到钥匙?
<table border="1">
<c:forEach items="${xml}" var="map">
<tr>
<c:choose>
<c:when test="${map.key =='name'}">
<td>${map.name}</td>
</c:when>
<c:when test="${map.key == 'catVal'}">
<td>${map.catVal}</td>
</c:when>
<c:when test="${map.key == 'catStat'}">
<td>${map.catStat}</td>
</c:when>
</c:choose>
</tr>
</c:forEach>