Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Iterating Collection of Integer

 
ShivPrakash Srivastava
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does this not work?
 
ShivPrakash Srivastava
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No...it gives me following error

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

Cheers
Shiv
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic