在Freemarker模板,我通过一个变量来<#list>
:FreeMarker的误差可迭代的<#list>
<#list sectorTags as sector>
<td colspan="${sector.designatedTags!?size}">${sector.name}</td>
<#else>
<td>No technology sectors defined.</td>
</#list>
但是失败:
06:25:03,733 SEVERE freemarker.core.NonSequenceOrCollectionException: Expected a sequence or collection, but this has evaluated to an extended_hash+string (com.tinkerpop.frames.structures.FramedVertexIterable wrapped into f.e.b.StringModel):
==> sectorTags [in template "reports/templates/techReport-punchCard.ftl" at line 105, column 32]
----
FTL stack trace ("~" means nesting-related):
- Failed at: #list-#else-container [in template "reports/templates/techReport-punchCard.ftl" at line 105, column 25]
----
at freemarker.core.IteratorBlock$IterationContext.executeNestedBlockInner(IteratorBlock.java:295)
...
这是怎么回事?
(我覆盖这个问题具有Q &一个,如果别人跑进 - 我还没有发现它在这里)
有关参考,请参阅[Iterable support PR](https://github.com/apache/incubator-freemarker/commit/f084603d7d9f76ae5bf0536d2ac6af2041a8db5d) –