struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amleto Di Salle" <>
Subject R: Logic:Iterate Problem
Date Wed, 23 Jun 2004 16:08:16 GMT
you can use the JSTL1.1 (or 1.0 as you want) in the following way:

<%@ taglib uri="" prefix="c" %>


    <c:forEach items="${requestScope.pageRecords}" var="row">
		<tr><c:out value="${row.Id}"/></tr>

you can use "pageScope", "requestScope", "sessionScope" or
"applicationScope" depending on the "pageRecords" is stored.

-----Messaggio originale-----
Da: Eddie Yan [] 
Inviato: mercoledì 23 giugno 2004 18.06
Oggetto: Logic:Iterate Problem

Hi guys,

Say I have a JSP as follows:

     Iterator iter = pageRecords.iterator();
         UserDetail detail = (UserDetail);
 <td>   <%= detail.getId() %> </td>

pageRecords is a Collection of UserDetail object.
UserDetail is my data transfer object.
I can manage to get the expected result of detail.getId()

How can I represent the above code in <logic:iterate> tags ? 
The following code doesn't work.

<logic:iterate id="myID" collection="pageRecords" property="UserDetail">
  <td> <bean:write name="myID" property="id" /> </td> </logic:iterate>
</tr> </table>

I got JSP Exception: Cannot create iterator for this collection

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

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

View raw message