#set($campaigns = ["one", "two", "three"])
#foreach($campaign in $campaigns)
List Item: $campaign
#end
-----------------------------------
Java code:
List
> campaings = new ArrayList
>();
List c1 = new ArrayList (); c1.add("1a");
c1.add("2a");
c1.add("3a");
c1.add("4a");
campaings.add(c1);
List
c2 = new ArrayList (); c2.add("1b");
c2.add("2b");
c2.add("3b");
c2.add("4b");
campaings.add(c2);
map.put("campaigns", campaings);
This notebook is a collection of code snippets and technical "how to" instructions.
Search This Blog
Velocity Template #foreach & #end loop with Java List
by: Zainab Aziz
To create a foreach loop to go iterate through a list of items :
Example of how you loop thru the above Java List of List(s) of String(s) using #foreach loops:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment