場合に使用してみてください。 "my_key"が設定されていることを確認します。
私はCを使用するときにいくつかの奇妙な理由でtest.xhtml
<html xmlns="http://www.w3.org/1999/xhtml" lang="en"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
<h:head>
<title>Test</title>
</h:head>
<h:body>
Key is set:<h:outputText value="${bean.coverageDataMap['my_key'] ne null}"/>
<br/>
<br/>
<c:forEach items="${bean.coverageDataMap['my_key']}"
var="entry" varStatus="loop">
<tr>
<td><h:outputText value="#{loop.index+1}"/></td>
<td><h:outputText value="#{entry}"/></td>
</tr>
</c:forEach>
</h:body>
TestBean.java
@ManagedBean(name = "bean")
@RequestScoped
public class TestBean implements Serializable{
private static final long serialVersionUID = 1L;
Map<String, List<String>> coverageDataMap;
public TestBean() {
coverageDataMap = new HashMap<>();
ArrayList<String> list = new ArrayList<>();
for (int i = 1; i <= 10; i++) {
list.add("hello" + i);
}
coverageDataMap.put("my_key", list);
}
public Map<String, List<String>> getCoverageDataMap() {
return coverageDataMap;
}
public void setCoverageDataMap(Map<String, List<String>> coverageDataMap) {
this.coverageDataMap = coverageDataMap;
}
}
が、それはタグで動作しますが、正常に動作しません。アウトタグ。 –
[here](https://stackoverflow.com/questions/13197016/jstl-cforeach-does-notiterate-through-a-collection)の説明に従って、JSTLのバージョンの問題があると思われます。 –