开发者

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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜