What about using reflection? You can automatically loop on all your "get"
methods and store them in a Collection without having to do it manually. The
problem with this is that you can't control the ordering... I don't know if
it's acceptable for you.

Another good thing of automatic reflection is that you can recursively get
into all your nested beans and re-apply the process. If you want an example
of how it can be done (in a different context :) ), you can take a look at
the code at:

http://www.mycgiserver.com/~andrej/technical/struts/struts.jsp

HTH

Andrej

> -----Original Message-----
> From: Peter Georgiou [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 11, 2002 7:53 AM
> To: Struts Users Mailing List
> Subject: iterate over bean attributes
> 
> 
> Hi
> 
> Is there a nice way to iterate over form bean attributes?
> 
> The only way I can think of is to copy all the form bean 
> attributes to a
> collection/array.... and then iterate over that data structure.
> 
> This situation arises because I'm displaying confirmation 
> page listing all
> the data from a previous form and I'm repeating lots of 
> tables, with the
> only changes each time being the bean attribute.
> 
> I was just wondering if there was a nicer way to do this than 
> that what i've
> described.
> 
> 
> Thanks
> 
> 
> Peter
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 

Reply via email to