gpt4 book ai didi

struts2 - Struts 2 FreeMarker 模板错误 stack.findValue ('top' ) is undefined

转载 作者:行者123 更新时间:2023-12-01 10:06:33 24 4
gpt4 key购买 nike

我还有一个关于 Struts2 的问题。

我正在制作图表和数据表。第一次加载我的图表时发生了什么(并单击图表数据以链接到数据表),它工作正常。但是当我更改图表中的参数并想要重新填充数据表时,它给了我这个错误:

Error on line 69, column 13 in template/simple/select.ftl
stack.findValue('top') is undefined.

不能赋值给itemKey

有问题的指令:

==> assignment: itemKey=stack.findValue('top') [on line 69, column 13 in
template/simple/select.ftl]
in user-directive s.iterator [on line 59, column 1 in template/simple/select.ftl]

堆栈跟踪

freemarker.core.InvalidReferenceException: Error on line 69, column 13 in template/simple/select.ftl
stack.findValue('top') is undefined.
It cannot be assigned to itemKey
at freemarker.core.Assignment.accept(Assignment.java:111)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.IfBlock.accept(IfBlock.java:82)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.Environment.visit(Environment.java:299)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:130)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.Environment.process(Environment.java:190)
at freemarker.template.Template.process(Template.java:237)
at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:157)
at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:559)
at org.apache.struts2.components.UIBean.end(UIBean.java:513)
at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
at org.apache.jsp.Annotate_jsp._jspx_meth_s_005fselect_005f9(Annotate_jsp.java:1086)
at org.apache.jsp.Annotate_jsp._jspx_meth_s_005fform_005f0(Annotate_jsp.java:629)
at org.apache.jsp.Annotate_jsp._jspService(Annotate_jsp.java:419)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja

我应该如何开始解决这个问题?

提前致谢:)

最佳答案

好吧,我知道这是一个过时的问题,但尽管我一直在努力寻找解决方案,但这是我通过链接找到的 here :

Null values added in List you are facing Template error..

once again going to check the database or check List values if u added Null values this problem will come..

因此,我正在检查我的列表,砰!这是正确的 - 中间有空值,struts/freemaker 现在知道该怎么做。

我的解决方案是在我的 SQL 中,我选择了我想要的字段并确保添加了“field IS NOT NULL”。从那以后,我的页面运行良好。

关于struts2 - Struts 2 FreeMarker 模板错误 stack.findValue ('top' ) is undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9837232/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com