如何在Velocity模板中迭代嵌套的Map?
我有一个这样的Map:
这张地图是用Java填充数据后呈现在HTML页面上的,但无法在HTML页面上进行迭代。
HashMap<String, HashMap<String, HashMap<String, List<MealPlanGroup>>>> termPlans=new HashMap<String, HashMap<String, HashMap<String, List<MealPlanGroup>>>>();
这张地图是用Java填充数据后呈现在HTML页面上的,但无法在HTML页面上进行迭代。
.getKey()
和.getValue()
getter 可以被.key
和.value
替换,Velocity 会自动调用 getter。 - Claude Brisson