【发布时间】:2019-10-04 11:47:22
【问题描述】:
问题:如何遍历从 json 输入读取的数组,该数组没有变量名/键。 我不想重新构建 json 文件,因为我必须编辑生成此 json 的服务,并且其他服务依赖于此文件并且也会受到影响。
已使用“.”发布了 javascript 的解决方案。作为 Mustache 模板中的数组名称:Can mustache iterate a top-level array? 此处为 Iterate over keyless array with mustache?
我对 Mustache 的 java 实现也有同样的疑问。
再次,输入数据(json)的示例:
[
{
"name" : "test",
"week" : "first",
"date" : "Wed Oct 02 14:06:35 GMT 2019",
"status" : "success"
}
]
【问题讨论】:
标签: java arrays loops mustache anonymous-arrays