Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Struts and the fly likes Iterating Collection of Integer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Iterating Collection of Integer" Watch "Iterating Collection of Integer" New topic
Author

Iterating Collection of Integer

ShivPrakash Srivastava
Ranch Hand

Joined: Mar 24, 2005
Posts: 88
Hi All,

It seemed a bit easy first but got confused.I want to use logic:iterate to iterate a list of Integer .

Iteration through a collection of object is very easy as we use the id attribute and say attribute.property which invokes the get method of associated with that property.How do we achieve this for collection of Integer?

Thanks in Advance
Cheers
Shiv
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Does this not work?
ShivPrakash Srivastava
Ranch Hand

Joined: Mar 24, 2005
Posts: 88
No...it gives me following error

Wrong format string: 'org.apache.struts.taglib.bean.format.int''

Cheers
Shiv
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Oh, sorry, my fault--I think using <bean:write> you need to use a format--since you're not using one from a resource file you need to specify one in the <bean:write> tag. I *think* it's as simple as adding a format="#" to the tag (whatever the Java decimal format stuff looks like; I don't rememver).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Iterating Collection of Integer
 
Similar Threads
about generics
Collection
Generic Question
Doubt in Generics
why is this working? a question on generics