tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chen, Gin" <Gin.C...@NielsenMedia.com>
Subject RE: how to ask length of collection in JSTL tags
Date Tue, 15 Jul 2003 15:58:18 GMT
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:dmitri.ilyin@gmx.net]
Sent: Tuesday, July 15, 2003 10:41 AM
To: taglibs-user@jakarta.apache.org
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: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message