File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
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
unable to iterate ArrayList which is in request scope. ArrayList contains bean
Iterate Hashmap through struts
Iterate List on jsp (struts)
Displaying Questions from Database in struts
Issue with <logic:iterate> Tag