freemarker遍历map

    技术2025-08-04  17

    java代码:

    Map root = new HashMap();  root.put("user", "Big Joe");  Map latest = new HashMap();  latest.put("url", "products/greenmouse.html");  latest.put("name", "green mouse");  root.put("latestProduct", latest);

     

    页面代码:

    username:${user}    <#list latestProduct?keys as color>   ${latestProduct[color]}  </#list>

     

    简单的,想怎么写就怎么写

    最新回复(0)