You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ogden John <JO...@carillionplc.com> on 2001/08/10 12:48:54 UTC

Logic:iterate tag

Hi,

I am having a problem with the logic:iterate tag.
I have a form object thats holds an array list of employee objects. I am
attempting to itterate over the list of employee objects, but currently the
iterate tag is only evaluated once.

The code I`m using is

	<logic:iterate id="element"
	               name="opprEmployeeForm"
	               property="opprEmployeeList">
	    
		 <output name>

	    <p>

	</logic:iterate>

Where opprEmployeeForm is my form object stored in page scope, and
opprEmployeeList is my array list of employee objects.
When run I get only a single line of output, even though I know there 6
element in the array list.

I can get this to work if I dont use tags, and instead drop the following
into my jsp, but I`d like to get this work using the tags for simplicity

<%	
	ArrayList al = opprEmployeeForm.getOpprEmployeeList();
	java.util.Iterator i = al.iterator();
	while(i.hasNext())
	{
		OpprEmployeeObject oe = (OpprEmployeeObject)i.next();
		out.print  (oe.getName());
	}
%>

Thanks for any help
John.


**********************************************************************
This email transmission is confidential and intended for the
addressee only. It may contain privileged and confidential
information. If you are not the person or organisation to
whom it is addressed, you must not copy, distribute, or take
any action in reliance upon it. If you have received this
message in error, please notify the
Postmaster@CarillionPLC.com and return it.

Carillion PLC Registered in England No. 3782379
Registered Office:
Birch Street Wolverhampton WV1 4HY
**********************************************************************

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.