This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts 1 : How to get last element using Struts logic iterate. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Struts 1 : How to get last element using Struts logic iterate." Watch "Struts 1 : How to get last element using Struts logic iterate." New topic
Author

Struts 1 : How to get last element using Struts logic iterate.

Chetan Ram
Greenhorn

Joined: Mar 10, 2011
Posts: 20
Hi,

I am new to struts.

I have an arraylist which contains beans

i.e. ArrayList --->
bean1 -- name, dept
bean2 -- name, dept
bean3 -- name, dept
bean4 -- name, dept

I want to iterate over the arraylist and print them comma separated.

I must put "," after every element expect last element.
Currently, I am using <logic:iterate>.



Can any one please let me know how to get last element?

Thanks,
Chinnu
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 1 : How to get last element using Struts logic iterate.
 
Similar Threads
Iterate List on jsp (struts)
unable to iterate ArrayList which is in request scope. ArrayList contains bean
Iterate Hashmap through struts
Issue with <logic:iterate> Tag
Displaying Questions from Database in struts