tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chen, Gin" <>
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 []
Sent: Tuesday, July 22, 2003 12:41 PM
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 test="${component.parentDao.children.size > 1}">
<!-- stuff here -->

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. 



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message