tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Long, Robert" <Robert.L...@travelocity.com>
Subject RE: What's the problem with this <c:foreach>?
Date Tue, 28 Jun 2005 18:41:14 GMT
Try this... assuming that listoffunds is a defined list...

<c:forEach var="fund" items="${listoffunds}" varStatus="status">



-----Original Message-----
From: lk [mailto:cesto@email.it] 
Sent: Tuesday, June 28, 2005 1:09 PM
To: taglibs-user@jakarta.apache.org
Subject: What's the problem with this <c:foreach>?

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

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