How to add values to dynamic(?) map in velocity?
I have the following velocity code.
#foreach($content in $list)
#set($map = {$content.categoryName:[]})
#foreach($child in $children)
// I want to add values to $map.$content.categoryName
#end
#end
I would like to add values to $map.$content.categoryName
. I tried
$map.$content.categoryName.add(values here)
but it didn't work. I al开发者_StackOverflowso tried
$map[$content.categoryName].add(values here)
But it still didn't work. Could someone please help me with this problem.
It's java, not javascript:
$map.get($content.categoryName).add($child.value)
精彩评论