On Wed, 24 Apr 2002, Shawn Bayern wrote:

> Are you asking, "Can something like this be done in JSTL?"  The answer is
> yes:
>
>   <c:forEach items="${myPhones}" var="col" varStatus="s">
>     <c:if test="${s.first}">My phones are<ul></c:if>
>     <li><c:out value="${col}"/></li>
>     <c:if test="${s.last}"></ul>.</p></c:if>
>   </c:forEach>
>
> This is useful because opening and closing <ul> tags won't print unless
> the collection has at least one item.  This avoids empty <ul></ul>
> elements (which normally display fine but are technically an error).
>

I was asking more if there could be a preForEach and postForEach internal
tags. It's not something I've seen in custom JSPs much yet, special
concents which do different things. So:

<c:preForEach varStatus="s">.....</c:preForEach>

etc. Take away the iffing and elsing for what is a very standard thing to
do.

Hen


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

Reply via email to