To whom it may concern, newbie-gero wrote:
ArrayList list = new ArrayList(); Map map = new HashMap();for ( int i=0; i < notificationList.size(); i++) { map.put("Variable"+i,notificationList.get(i));}
Note: key values start with "Variable" (with a leading capital letter).
list.add(map);
Ok. [snip]
context.put("emailList", list);
Ok.
#foreach ( $email in $emailList)
Transaction No: $email.variable0
<br/>
I think you want:
Transation No: $email.Variable0
Velocity first looks for a method called "getVaraiable0()" on whatever
object "email" is. Since "email" is a map, that method does not exist.
Then, Velocity looks for a method called "get" that takes a String
argument (which Map does), and calls get with the String from the
reference (in this case, "varaiable0"). Note that the lookup is
case-sensitive.
I think you just need to capitalize "Variable0" and you'll be good to go. -chris
signature.asc
Description: OpenPGP digital signature
