tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lk <ce...@email.it>
Subject What's the problem with this <c:foreach>?
Date Tue, 28 Jun 2005 18:09:07 GMT
Hi,

I have a Collection of Object and I would to iterate through the Collection.

I use this code:

<c:forEach var="fund" items="listoffunds" varStatus="status">
     <c:out value="${fund.name}" />
     <c:out value="${status.count}" />
</c:forEach>

Running the jsp I get this error:

[ServletException in:/inc/box_societa.jsp] An error occurred while 
evaluating custom action attribute "value" with value "${fund.name}": 
Unable to find a value for "name" in object of class "java.lang.String" 
using operator "." (null)'

I'm sure the list contains 1 element, and that element has a name.
If I try to use this tag:

     <c:out value="${listoffunds[0].name}" />

I got the name of the fund!

What could be the error?

Thanks
 
 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 la vetrina delle aziende del Canavese industriali, artigianali e di servizi
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3606&d=28-6

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