<#list .globals?keys as vals>
${vals}
</#list>
FreeMarker template error: For "?keys" left-hand operand: Expected an extended
hash, but this has evaluated to a hash (wrapper: f.c.Environment$4):
==> .globals [in template "contents/globals.ftl" at line 9, column 8]换句话说,如何呈现没有在FreeMarker中扩展的散列的键?(我正在使用带fmpp的node.js,而不是用Java进行开发)
发布于 2015-09-09 17:12:32
正如评论中所述,globals的键是不可访问的。globals是一个散列,没有扩展的散列。这意味着,您不能使用built-ins for hashes访问它们的键和值。
您可以通过使用is_hash_ext来判断散列是否被扩展(并因此支持那些内置的)。
https://stackoverflow.com/questions/32257316
复制相似问题