You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jason Vinson <vi...@mindspring.com> on 2003/03/14 15:59:04 UTC

logic:iterate and collections

I am putting a collection on the request as an attribute, and i can't access it for some reason.  Maybe a few of you could shed some light on this problem:

<jsp>
  <logic:iterate collection="nestResults" id="spgExtendedSearchForm">
</jsp>

<console output>
javax.servlet.jsp.JspException: Cannot create iterator for this collection
</console output>

nestResults is an ArrayList, and I have even tried using the .toArray() method on it with no success.  When i cheat and put some code in the jsp to check the attributes, i see that it's present:

ATTR: nestResults is [Ljava.lang.Object;@33934d

Any idea what i need to do here?
Jason

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: logic:iterate and collections

Posted by apachep2 <ap...@hotmail.com>.
I wrap my collection in a bean

<logic:iterate name="mybean" property="mycollection" id="myelement">

-----Original Message-----
From: Jason Vinson [mailto:vinsonizer@mindspring.com] 
Sent: March 14, 2003 9:59 AM
To: Struts Users Mailing List
Subject: logic:iterate and collections

I am putting a collection on the request as an attribute, and i can't
access it for some reason.  Maybe a few of you could shed some light on
this problem:

<jsp>
  <logic:iterate collection="nestResults" id="spgExtendedSearchForm">
</jsp>

<console output>
javax.servlet.jsp.JspException: Cannot create iterator for this
collection
</console output>

nestResults is an ArrayList, and I have even tried using the .toArray()
method on it with no success.  When i cheat and put some code in the jsp
to check the attributes, i see that it's present:

ATTR: nestResults is [Ljava.lang.Object;@33934d

Any idea what i need to do here?
Jason

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org