tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Long, Robert" <>
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 [] 
Sent: Tuesday, June 28, 2005 1:09 PM
Subject: What's the problem with this <c:foreach>?


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

I use this code:

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

Running the jsp I get this error:

[ServletException in:/inc/box_societa.jsp] An error occurred while 
evaluating custom action attribute "value" with value "${}": 
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?

 --, the professional e-mail, gratis per te:
 la vetrina delle aziende del Canavese industriali, artigianali e di
 Clicca qui:

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

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

View raw message