You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mano Pájaro <ma...@gmail.com> on 2011/07/29 18:38:01 UTC

Problem with , FreeMarker template Error

Hello list!! I'm having a problema with this tag, I don't know what to do :(
I hope you guys could help me.
As here says http://struts.apache.org/2.2.3/docs/checkboxlist.html I can use
a Map object in the list attribute of a checkboxlist, When i go for it I got
this FreeMarker template error:

FreeMarker template error!


Expression parameters.name is undefined on line 38, column 32 in
template/simple/checkboxlist.ftl.
The problematic instruction:
----------
==> ${parameters.name?html} [on line 38, column 30 in
template/simple/checkboxlist.ftl]
 in user-directive s.iterator [on line 25, column 5 in
template/simple/checkboxlist.ftl]
 in include "/${parameters.templateDir}/simple/checkboxlist.ftl" [on line
25, column 1 in template/xhtml/checkboxlist.ftl]
----------

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression parameters.name is
undefined on line 38, column 32 in template/simple/checkboxlist.ftl.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
at freemarker.core.Expression.getStringValue(Expression.java:118)
at freemarker.core.Expression.getStringValue(Expression.java:93)
at
freemarker.core.StringBuiltins$StringBuiltIn._getAsTemplateModel(StringBuiltins.java:71)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.Expression.getStringValue(Expression.java:93)
at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
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.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.include(Environment.java:1483)
at freemarker.core.Include.accept(Include.java:169)
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.jsp.GuardarAlumnoForm_jsp._jspx_met


Even weirder, when I use a List object (because, i don't know, maybe List
would work), I also get the same error!
I don't know if this is a bug or I am doing something wrong. In the action
class I define a Map<Integer,String> objected implemented as HashMap, and
List<String> as ArrayList, I dont' even know what freemarker is :(
Thank you for your help

-- 
Manolo Pájaro Santander
Ingeniero de Sistemas VIII Semestre (Actual)
<<Promoviendo el Software Libre>>
CUSOL-UAC
Linux Registered User # 522026

Re: Problem with , FreeMarker template Error

Posted by Mano Pájaro <ma...@gmail.com>.
Hello guys, I'm sorry i didn's post any code of my problem, I already solved
it, the name attribute was missing in my example. I went with key attribute
and is already working, thanks anyway!

-- 
Manolo Pájaro Santander
Ingeniero de Sistemas VIII Semestre (Actual)
<<Promoviendo el Software Libre>>
CUSOL-UAC
Linux Registered User # 522026