Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to break a foreach loop?

800332Nov 26 2004 — edited Sep 19 2008
Hi guys,

How can I break a foreach loop if i got the following code:

<c:forEach items="${stuff.stuffPostingImages}" var="img" varStatus="imgstatus">
<c:if test="${img.sequence=='1'}">
<c:out value="${img.imagePath}" />
</c:if>
</c:forEach>

mean once img.sequence==1 then will print out then exit the loop. Please help, Thanks !

regards,
kmthien
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 17 2008
Added on Nov 26 2004
11 comments
11,583 views