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
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
 
wood burning stoves
 
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
Displaying Questions from Database in struts
Iterate List on jsp (struts)
Iterate Hashmap through struts
Issue with <logic:iterate> Tag