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: Length of collection using EL?
Date Tue, 22 Jul 2003 16:48:01 GMT
Use the archives.. its been discussed SO many times already.

-----Original Message-----
From: Sgarlata Matt [mailto:sgarlata_matt@bah.com]
Sent: Tuesday, July 22, 2003 12:41 PM
To: taglibs-user@jakarta.apache.org
Subject: Length of collection using EL?


Does anyone know how to get the length of a collection using the EL?  I am
trying to do one of the tests below.  Note that "children" is a List.

<c:if test="${component.parentDao.children.length > 1}">
<!-- stuff here -->
</c:if>

or 

<c:if test="${component.parentDao.children.size > 1}">
<!-- stuff here -->
</c:if>

And get this error:

javax.servlet.jsp.JspException: An error occurred while evaluating custom
action attribute "test" with value "${component.parentDao.children.length >
1}": The "." operator was supplied with an index value of type
"java.lang.String" to be applied to a List or array, but that value cannot
be converted to an integer. 

Thanks!

Matt

---------------------------------------------------------------------
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