Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Struts iterate tag

843838Apr 23 2007 — edited Sep 28 2007
I have an ArrayList object that contains a collection of Listing objects.
The Listing object has two methods getID, getName and is a business object.

In the ActionForm there is a variable listingData of java.util.List type. How can I use the logic:iterate tag to traverse the ArrayList object and display the id and name of the Listing objects?

What has to be added in the logic:iterate tag below?
<table>
<logic:iterate id="listingForm" name="listingForm" property="listingData"> 
 
<tr>
<td>
// Here I want to output the value of Listing object id field
</td>
<td>
// Here I want to output the value of Listing object name field
</tr>
 
</logic:iterate>
</table>
Do I need a nested logic:iterate tag?

Should the ArrayList be populated with a J2SE class rather than a business object, i.e. the Listing class?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 26 2007
Added on Apr 23 2007
16 comments
547 views