"ERROR EN PAGINA JSP : Cannot create iterator for this collection"
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   andrea_lorena
Posted On:   Wednesday, May 21, 2003 11:33 AM

I'm working with hashmap that I send to one jsp, the content of this hashmap are dtos. Use tag logic:iterate but appears to me the following error that I do not know to what it talks about: "ERROR EN PAGINA JSP : Cannot create iterator for this collection" and the code in jsp page is the following: <% pageContext.setAttribute("edadesSexo", dto.get("edades")); %> <% interfaz.GenericDto dtoEA = (interfaz.GenericDto)dtoi; %> <% if (dtoEA != null){ %> <%= dtoEA.get("edad")%> <%= dtoEA.get("ctotal")%> <% }; %> thanks, ve   More>>

I'm working with hashmap that I send to one jsp, the content of this hashmap are dtos. Use tag logic:iterate but appears to me the following error that I do not know to what it talks about:

"ERROR EN PAGINA JSP : Cannot create iterator for this collection"


and the code in jsp page is the following:


<% pageContext.setAttribute("edadesSexo", dto.get("edades")); %>



<% interfaz.GenericDto dtoEA = (interfaz.GenericDto)dtoi; %>
<% if (dtoEA != null){ %>



<%= dtoEA.get("edad")%>

<%= dtoEA.get("ctotal")%>



<% }; %>



thanks, very much!!

and

   <<Less

Re: "ERROR EN PAGINA JSP : Cannot create iterator for this collection"

Posted By:   Christopher_Koenigsberg  
Posted On:   Wednesday, May 21, 2003 02:02 PM

I think (?), that when you give both the "collection" and "name" attributes to the "logic:iterate", that you are telling it to find the "name" in the scope (which you left default), and then do a get on the "collection" as a property, in order to retrieve the actual Collection object.



So in your example:



I think (?) you are saying that there is an Attribute of the default scope (session?), under the name "edadesSexo" (from your "name" attribute). And this object has a method, "getEdadesSexo()" on it (from your "collection" attribute), which will then return an object that implements some Collection subinterface e.g. a List etc.

About | Sitemap | Contact