<ui:repeat var="aClip" value="#{manageClipModel.clipList}">
<ui:repeat value="#{aClip.revisions}" var="revs">
rev id <h:outputText value="#{revs.revId}"/> //dispalys value
map len #{fn:length(revs.metadataMap.entry)} //displays right size of map
<c:forEach items="#{revs.metadataMap.entry}" var="entry">
key <h:outputText value="#{abc.key}"/> //does not iterate this loop
</c:forEach>
</ui:repeat>
在java值中正确显示
for (Clip aClip : clipList) {
System.out.println("comment " + aClip.getComment() + " clip id " + Clip.getClipId());
List<Revision> revs = aClip.getRevisions();
System.out.println("rev size"+revs.size());
if (revs != null && !revs.isEmpty()) {
for (Revision aRev : revs) {
System.out.println("metadata map size " + aRev.getMetadataMap().getEntry().size());
Iterator itr = aRev.getMetadataMap().getEntry().listIterator();
while (itr.hasNext()) {
Revision.MetadataMap.Entry entry = (Revision.MetadataMap.Entry) itr.next();
System.out.println("key " + entry.getKey());
System.out.println("value " + entry.getValue().getValues().toString());
}
}
}
}
}
有人能指出我在做什么错吗?
答案 0 :(得分:0)
(OP在问题编辑中回答问题。转换为社区维基答案。请参阅Question with no answers, but issue solved in the comments (or extended in chat))
OP写道:解决了我错过了一个从Java代码循环
listIterator
的步骤。
<ui:repeat value="#{aClip.revisions}" var="revs">
<ui:repeat value="#{revs.metadataMap.entry}" var="entryLst">//was missing this loop
<ui:repeat value="#{entryLst}" var="entry">
<ui:repeat value="#{entry.value}" var="metaVal">
changedFromPrevious - <h:outputText value="#metaVal.changedFromPrevious}"/>
key - <h:outputText value="#{metaVal.key}"/>
<ui:repeat value="#{metaVal.values}" var="aValue">
<h:outputText value="#{aValue}"/>
</ui:repeat>
</ui:repeat>
</ui:repeat>
</ui:repeat>