<c:forEach....> <h:outputText ..../> </c:forEach...>

I want to loop through in JSF and I am using

<c:forEach var="i" begin="1" end="5" varStatus="status">

<h:outputText value="Hello Roshan" />

</c:forEach>

But this is not working. I need to loop for similear working. Any workarround or better solution would be appriciated.

Thanks.

[335 byte] By [Doga] at [2007-11-27 8:03:33]
# 1

Hi,

You can try using the Facelets repeat component if you are using Facelets.

With Facelets isn抰 possible to use start-end indexes, only collections.

<ui:repeat value="#{bean.items}" var="item">

<ui:include src="#{item.src}"/>

</ui:repeat>

But forEach should also work with begin-end or a collection (items).

<c:forEach begin="1" end="5" var="count">

${count} * 10 = ${count * 10}

</c:forEach>

Best Regards

Dimia at 2007-7-12 19:45:41 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Only JSF 1.2 supports this feature.
Java.Developera at 2007-7-12 19:45:41 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...