在Java中:
Map<String, Object> model = new HashMap<>();
Map<String, String> items = new HashMap<>();
items.put("color", "red");
model.put("items", items);
现在,如果items
包含key ,我想在渲染的模板中包含一个片段color
。
<#if ???? >
the map contains a key called color
</#if>
我该替换什么?与?
您可以??
像这样使用运算符:
<#if items['color']?? >
the map contains a key called color
</#if>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句