Reputation: 9986
TITLLE [...]
<logic:iterate id="listClient" name="Client">
<table>
<tr>
<td>
[...]
</td>
</tr>
</table>
</logic:iterate>
But i have this error for my second iterate
javax.servlet.jsp.JspException: Cannot create iterator for this collection
Upvotes: 1
Views: 6264
Reputation: 1
use this type of iterater to solve this problem.............
<tr>
<td><b>RECD from :</b>
<select name="vo.cuttingRecivedFrom" >
<option value="">select</option>
<logic:notEmpty name="storeList">
<logic:iterate name="storeList" id="storeList1" indexId="count">
<option value="<bean:write name="storeList1" property="storeName"/>"><bean:write name="storeList1" property="storeName"/></option>
</logic:iterate>
</logic:notEmpty>
</select>
</td>
<td><b>RECD in :</b>
<select name="vo.cuttingRecivedFrom" >
<option value="">select</option>
<logic:notEmpty name="storeList">
<logic:iterate name="storeList" id="storeList1" indexId="count1">
<option value="<bean:write name="storeList1" property="storeName"/>"><bean:write name="storeList1" property="storeName"/></option>
</logic:iterate>
</logic:notEmpty>
</select>
</td>
</tr>
Upvotes: 0
Reputation:
The Cannot create iterator for this collection
message is thrown by the iterate tag when it is not able to create an iterator for the collection you are passing to it.
The tag extracts an object from scope using the specified name, in this case Client
and starts to check what type it is:
If it finds one of this object types it extracts the iterator in the appropriate way. If none of the above are a match you get javax.servlet.jsp.JspException: Cannot create iterator for this collection
.
At this point I agree with Adeel Ansari's comment: "it doesn't make any sense to me when you are able to iterate once, but not again".
Are you doing something to the Client
bean between the two iterator tags (i.e. is the presented code continuous in regards of the iterator tags)? Maybe you overwrite it with something that ain't a collection?
Upvotes: 4