Struts 2 FreeMarker template error. Stack.findValue ('top') - undefined

I have another question for Struts2.

I have done a chart and data. What happens with the first load of my chart (and clicking the chart data to link to the data), it works fine. But when I changed the parameter in my chart and wanted to repopulate the data, it gives me this error:

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

      

Unable to assign itemKey

Problematic instruction:

==> 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]

      

StackTrace

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

      

How do I fix this?

Thank you in advance:)

+3


source to share


1 answer


OK I know this is a backward problem, but as far as I struggled to find solutions, here's what I found from the link here :

Null values ​​added to the list you are facing Template error.

will check database again or check list values ​​if u added Null values ​​this problem will come ..



So I went through the list and bam! That was correct: there were zero values ​​in between, and that struts / freemaker now knew what to do.

My solution was in my SQL, I selected the field I wanted, and to make sure I added "field IS NOT NULL". My page worked well after that.

+7


source







All Articles