I’ve been doing this:
#set ($products_map = $rx.string.stringToMap(" = "))
$products_map.remove(" ")
But is there a cleaner way? This seems to generate a syntax error:
#set($products_map = {})
I’ve been doing this:
#set ($products_map = $rx.string.stringToMap(" = "))
$products_map.remove(" ")
But is there a cleaner way? This seems to generate a syntax error:
#set($products_map = {})
I believe that JEXL allows you to create empty maps, while Velocity for some reason does not.
There is also the $rx.string.stringToMap() function. If you pass it an empty string, you’ll get an empty map.