FTL stack trace ("~" means nesting-related):
- Failed at: #list content as item [in template "article.ftl" at line 40, column 17]
----
at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing(IteratorBlock.java:359)
at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(IteratorBlock.java:271)
at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:244)
at freemarker.core.Environment.visitIteratorBlock(Environment.java:657)
at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:108)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:94)
at freemarker.core.Environment.visit(Environment.java:347)
at freemarker.core.Environment.visit(Environment.java:353)
at freemarker.core.Environment.visit(Environment.java:353)
at freemarker.core.Environment.process(Environment.java:326)
at freemarker.template.Template.process(Template.java:383)
at com.atricle.test.ArticleFreemarkerTest.createStaticUrlTest(ArticleFreemarkerTest.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:686)
at org.junit.jupiter.engine.execution.MethodInvocatio
springboot 集成freemarker 启动报错异常信息如下
最新推荐文章于 2024-02-26 11:51:48 发布
在SpringBoot项目中集成FreeMarker模板引擎时遇到了启动报错,错误源于在'(article.ftl'文件第40行)尝试将内容(content)作为一个item进行迭代,但内容可能未正确解析为集合。报错堆栈跟踪涉及FreeMarker的内部执行流程。为解决此问题,需要确保在模板中遍历的内容已转化为JSON集合。
摘要由CSDN通过智能技术生成