How to set the value of the card in speed

I tried to define a map in a speed template using the following syntax. This did not work, does anyone know how to declare a constant value map in speed?

#set ($mymap = {"key" : "value" , "key2" : "value"}) 

EDIT: I am using speed version 1.6.3

+6
source share
1 answer

It worked for me. Maybe you have a very old version of Velocity?

 #set ($mymap = {"key" : "value" , "key2" : "value2"}) get: ${mymap.key} or: ${mymap.get("key")} 
+9
source

Source: https://habr.com/ru/post/885536/


All Articles