This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts iterate tag and formatting

 
david allen
Ranch Hand
Posts: 185
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have returned a collection of objects and am using the iterate tag to loop through them and display there names in a table.

However, intsead of displaying them like this:
onject 1
object 2
object 3
object 4

I would like to display them as this

object 1 object 2
object 3 object 4

Does anyone know of a good way of doing this?

Is there anyway you can specify if commands in the iterate tag and access the counter used by the tag?
This way I could test the following

if(counter mod 2 == 0) then insert new row

thank you

david
 
Junilu Lacar
Bartender
Pie
Posts: 6529
21
Java Linux Mac Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suggest moving to JSTL.



Also see this: http://www-106.ibm.com/developerworks/java/library/j-jstl0318/
 
John Smith
Ranch Hand
Posts: 61
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah the jstl c:forEach works or you can use the index attribute in your current logic:iterate, you can do your mod test on that
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic