Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Struts and the fly likes How to iterate Array List Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to iterate Array List" Watch "How to iterate Array List" New topic

How to iterate Array List

Pramod Kumar
Ranch Hand

Joined: Oct 05, 2007
Posts: 40
Hi, I have a arraylist and I need to iterate and display the values with <bean:write

here is the code

<bean:write name="allnames" />

I am adding allnames.add("name1");......etc

it is displaying in browser as [name1, name2] in a single row I need to be displayed seperately.

<bean:write name="allnames" property="?"/>

what is the property name here I need to give?
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32628

Wy not use logic:iterate? You can still use bean:write on each iteration through the loop.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: How to iterate Array List
jQuery in Action, 3rd edition