You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Keith Morrell <Ke...@telecom.co.nz> on 2001/04/23 07:12:57 UTC

Iterate over a bean full of beans?

I have an issue where I want to iterate using a bean which has "child"
beans (excuse the non-industry standard lingo!) and would appreciate
some advice (sorry this is my third post today, but I have been
struggling with this and a couple of other issues for days now..)

The old code went something like:

<% Iterator it = Summary.getAccounts().iterator();
	if(it.hasNext())....

... and then within this loop, 

<% while( it.hasNext() )
{
  AccountBean ab = (AccountBean) it.next();
  out.println( ab.getName(); 
  out.println( ab.getPhone(); 

... etc...

Any help etc would be appreciated...as i am not sure how to access the
child bean properties etc from the main bean (which would control the
iterate loop)

Thanks,




Please note new  extension number/s below...

Keith Morrell
EDS Consultant, TRAID Project

Phone +64-9-308-5650 
EDS internal  extn 4150   
>From Telecom PABX  84150
Fax      +64-9-309-8543
Cell      +64-21-649-395

Email T906399 (internal) or keith.morrell@telecom.co.nz