If you just want the first item in the collection you might be able to use:

<c:forEach items="${lecContacts}" var="lecContactFirst" begin="0" end="0">

<c:set var="lecContactId" value="${lecContactFirst}"/>

</c:forEach>


this should iterate over only the first item and then end (i hope). Or else you might try this, without the iteration

<c:set var="lecContactId" value="${lecContact[0]}"/>

which should get item at index 0 from the array or list..

Balakrishnan, Vijay wrote:

Hi,

I want to use a break in a c:forEach as follows:

c:forEach items="${lecContacts}" var="lecContactFirst" varStatus="status">
<c:choose>
<c:when test="${status.first}">
<c:set var="lecContactId" value="${lecContactFirst}"
/>
</c:when>
<c:otherwise>
<!-- break here How to do that ??-->
</c:otherwise>
</c:choose>
</c:forEach>


I don't want to use flag if that is possible.

Thanks in advance,
Vijay

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






--
Jason Lea




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to