2
在Java中的特定键:检查如果地图包含的Freemarker
Map<String, Object> model = new HashMap<>();
Map<String, String> items = new HashMap<>();
items.put("color", "red");
model.put("items", items);
我现在想包括一个片段在我的呈现模板,如果items
包含密钥color
。
<#if ???? >
the map contains a key called color
</#if>
我怎么更换????用?
或者,如果钥匙确实是一个常数,那么就'items.color ??'。 – ddekany