The best way to do this IMHO is to use a combination of Struts and EL.
Use:
<bean:size id="collectionLength" collection="collection"/>
<c:if test="${collectionLength == 1}">
that's it
</c:if>
Replace collection with name in the bean:size if that doesn't work. (Cant
remember the syntax too lazy to look up my own stuff).
-Tim
-----Original Message-----
From: Dmitri Ilyin [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 10:41 AM
To: [EMAIL PROTECTED]
Subject: how to ask length of collection in JSTL tags
Hi,
how can i get the length(size) of the collection??
I have a collection in page scope and i'd like to check the length of this
collection.
I use <c:if test="${collection.length == 1}">
that's it
</c:if>
"collection.length" returns always 0. the same with "collection.size" and
"collection.itemCount"
HELP!!
thanks a lot
regards
Dmitri
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]