tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Geary <sabrew...@earthlink.net>
Subject Re: c:set Collection size
Date Thu, 05 Sep 2002 16:12:30 GMT
You can't access methods that aren't JavaBeans-compliant getter methods 
with the JSTL expression language, but you can do this:

<%@ taglib uri='http://java.sun.com/jstl/core_rt' prefix='core_rt' %>
...
<c_rt:set var='total' value='<%= list.size %>'/>


david

Hari Mukkala wrote:

>I am trying to get the size of a collection (ArrayList) and
>use in  c:set ex:
><c:set var="total" value="${list.size}/>
>
>The error I am getting is:
>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
>
>What is the correct way to get the size value.
>
>Thanks,
>Hari.
>
>--
>To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>
>
>
>  
>



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


Mime
View raw message