模拟后台传过来的 json 字符串
<#assign text>
{"res":"0","msg":"OK","userlist":[{"id":"3","name":"cc","sex":"女","age":"20"}]}
</#assign>
text为服务器后台传递的json数据,在freemarker页面进行解析
<#assign json=text?eval/>
然后json数据就被解析成json格式了,可以按key进行取值
<#list json.userlist as item>
id:${item.id}, name:${item.name},sex:${item.sex}
</#list>