Use the archives.. its been discussed SO many times already.

-----Original Message-----
From: Sgarlata Matt [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 22, 2003 12:41 PM
To: [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to