×

Please give details of the problem

Skip to content

How to access the keys and the values of a JSONObject

1
2
3
4
<#assign my_structure = {"titi":"toutou","tata":"toto"}>
<#list my_structure?keys as x>
key : ${x} - value : ${my_structure[x]}
<!--#list-->

will return

1
2
key : titi - value : toutou  
key : tata - value : toto