Hi all,
I know that
my question is common, but I�m still struggling with the iterate
tag.
Please can somebody help me?
When I�m using the logic:iterate tag I get only the following error:
"javax.servlet.ServletException: Cannot create iterator for this collection"
The not working code is:
"javax.servlet.ServletException: Cannot create iterator for this collection"
The not working code is:
<jsp:useBean id="myUser" scope="session"
class="com.aspo.Model.User"/>
<logic:iterate id="profile" name="myUser" property="userProfiles">
<tr>
<td align="left">
<bean:write name="profile" property="name" filter="true"/>
</td>
</tr>
</logic:iterate>
</logic:iterate>
************************************************************************************
The same iteration works with this code:
<%
ListIterator profileIterator = myUser.getUserProfiles().findAll();
while (profileIterator != null && profileIterator.hasNext()) {
UserProfile profile = (UserProfile) profileIterator.next();
%>
<tr>
ListIterator profileIterator = myUser.getUserProfiles().findAll();
while (profileIterator != null && profileIterator.hasNext()) {
UserProfile profile = (UserProfile) profileIterator.next();
%>
<tr>
<td width="330px"><a
class="list" href="editProfile.do?action=Edit"><%= profile.getName()
%></a></td>
</tr>
<%
</tr>
<%
}
%>
Can anybody tell me what I'm doing wrong?
Thanks,
Thanks,
Katarina

