Group: comp.lang.java.programmer
From: "Trevor"
Date: Wednesday, April 02, 2008 9:51 AM
Subject: Struts logic:iterator for 2d array

Hi,

I am using Struts 1.3 with Hibernate. If I run a simple HQL query in one of
my data access objects (e.g. "from users as u"), this returns a list to my
actionform which I can iterate through in my jsp as follows:

scope="request">




The above works fine. However when trying to run a query that joins two
tables together (e.g. "from users as u inner join u.addresses as a") this
returns a 2D list in the format:

Element 0
User
Address
Element 1
User
Address

Which I cannot use in my jsp as the is iterating over the
top-level elements and not the user/address objects. I think I need to have
nested tags but not sure of the syntax or how this affects
my actionform.

Any help of guidence on this would be very much appreciated.

Thanks
Trev