<h:dataTable value="#{SearchingBeans.list}" var="entry">
<h:column>
<f:facet name="header">
<h:outputLabel>Photo</h:outputLabel>
</f:facet>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel>Pseudo</h:outputLabel>
</f:facet>
<h:outputLabel value="#{entry.pseudo}"></h:outputLabel>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel>Description</h:outputLabel>
</f:facet>
<h:outputLabel value="#{entry.description}"></h:outputLabel>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel>Photo</h:outputLabel>
</f:facet>
<h:outputLabel value="#{entry.photo[0].path}"></h:outputLabel> <-- this a List
</h:column>
</h:dataTable>
我有一个实体的成员对自己的财产之一是列表的照片具有get/set 该属性是填充 我不知道如何获取在JSF该值我只需要每个成员的第一张照片,因为他们有2-3张照片。它有可能?任何其他解决方案将不胜感激。迭代里面^ h嵌套列表属性:数据表
如果您有'List'类型的'entry.list',可以使用EL'empty'检查其内容,然后使用'[0]'访问其第一个元素,如果我有你的想法正常。 – skuntsel