freemarker中Map of Map的迭代Map
Iterating Map of Map of Map in freemarker
我需要用 freemarker 语言迭代这张地图。
public static void main(String[] args) {
Map<String, Map<String, Map<String,String>>> map = new HashMap<>();
}
基于我需要获取映射的每个字符串,然后再次基于字符串再次需要映射。
谢谢
似乎有三级嵌套地图,您可以使用 list and you can show both key and value
向下钻取
Listing hashes is very similar, but you need to provide two variable names after the as; one for the hash key, and another for the associated value.
<#list map?values as vals>
<#list vals?values as innervals>
<#list innervals as name, innerValue>
${name} value = ${innerValue}
</#list>
</#list>
</#list>
我需要用 freemarker 语言迭代这张地图。
public static void main(String[] args) {
Map<String, Map<String, Map<String,String>>> map = new HashMap<>();
}
基于我需要获取映射的每个字符串,然后再次基于字符串再次需要映射。 谢谢
似乎有三级嵌套地图,您可以使用 list and you can show both key and value
向下钻取Listing hashes is very similar, but you need to provide two variable names after the as; one for the hash key, and another for the associated value.
<#list map?values as vals>
<#list vals?values as innervals>
<#list innervals as name, innerValue>
${name} value = ${innerValue}
</#list>
</#list>
</#list>