In JSP and JSTL I would normaly do something like this:
<c:forEach items="${userList}" var = "user">
<div id = "user-block">
<h1>${user.name}</h1>
<div id = "user-description">
<p>${user.description}</p>
</div>
<ul>
<li> Age: ${user.age} </li>
<li> City: ${user.city} </li>
<li> Country: ${user.country} </li>
</ul>
</div>
</c:forEach>
I'm trying to gain the same result using Facelet Composite Components:
<cc:interface>
<cc:attribute name="value" type="java.util.List" required="true" shortDescription="The list of objects that should be displayed"/>
</cc:interface>
<cc:implementation>
<div class = "event-block">
</div>
</cc:implementation>
The problem is that I don't know how to iterate over the objects in #{cc.attrs.value}.
LE: I would like to know if there is a way to solve this without using JSP or JSTL
[java]
when the question doesn't concern a basic Java code/language problem (which in turn is essentially unrelated to JSF then). This prevents[java]
nitwits who are downvoting questions they didn't understand and/or posting nonsensicial comments/answers (and this also prevents default XML/XHTML syntax highlighting being messed up due to higher precedence of[java]
tag). – BalusC