我有一个看起来像这样的模板:
#set($list = [])
#foreach($x in $_global.get('agg'))
$list.add($x.data.listingID)
#end
{
"queueName": "TEST",
"hosts": "localhost",
"credentials": {
"username": "guest",
"password": "guest"
},
"payload" : {
"userId" : "$_event.get('id')",
"aggData" : $vch.toJSON($list)
}
}
在针对示例有效负载进行渲染时,我得到类似这样的内容:
true
true
{ "queueName": "BRO-EM-MPNACC00CARTDEV1",
"hosts": "localhost",
"credentials": {
"username": "guest",
"password": "guest"
},
"payload" : {
"userId" : //id,
"aggData" : //something
}
}
我如何处理foreach return' true' ?
答案 0 :(得分:2)