How to add a property to a map dynamically in velocity?

I have the following code

$pageName = "test";

$Container = {};

I like to set a property of $Container by a variable. I tried $Container.set("test", $pageName);. It didn't raise any errors, but $Container.test or $Container.get("test"); display nothing.

How do I fix it?

5
задан Regexident 31 March 2015 в 23:41
поделиться