Skip to content

Instantly share code, notes, and snippets.

@zhangsida
Created February 25, 2014 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save zhangsida/9206849 to your computer and use it in GitHub Desktop.
Save zhangsida/9206849 to your computer and use it in GitHub Desktop.
Methode 1
<p:dataTable var="entry" value="#{hashMap.entrySet().toArray()}">
<p:column headerText="key">
<h:outputText value="${entry.key}" />
</p:column>
<p:column headerText="value id">
<h:outputText value="${entry.value.id}" />
</p:column>
</p:dataTable>
Methode 2
<ui:repeat var="entry" value="#{hashMap.entrySet().toArray()}">
key:#{entry.key}, Id: #{entry.value.id}
</ui:repeat>
Methode 3
<h:panelGrid columns="2" width="100%">
<c:forEach var="entry" items="${hashMap}">
<h:outputText value="${entry.key}" />
<h:outputText value="${entry.value.id}" />
</c:forEach>
</h:panelGrid>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment