You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jason Thurston <ja...@gmail.com> on 2007/04/17 21:56:01 UTC

struts 2.0.7 template/simple/select.ftl error/fix

To fix I extracted template/simple/select.ftl from the
struts2-core-2.0.7.jar to WEB-INF/classes/template/simple/select.ftl

I then
changed line 60 from:
    <option value="${itemKey?html}"<#rt/>
to:
 <option value="${itemKeyStr?html}"<#rt/>

and I inserted the following line before line 60:
<#assign itemKeyStr=itemKey.toString() />

I got the idea from another .ftl file that does something similar.


The error message this fixed was:

Error on line 60, column 22 in template/simple/select.ftl
 Expecting a string, date or number here, Expression itemKey is instead a
freemarker.ext.beans.BooleanModel
 The problematic instruction:

----------
==> ${itemKey?html} [on line 60, column 20 in template/simple/select.ftl]
in user-directive s.iterator [on line 41, column 1 in
template/simple/select.ftl]
----------
Java backtrace for programmers:
----------
freemarker.core.NonStringException: Error on line 60, column 22 in
template/simple/select.ftl
Expecting a string, date or number here, Expression itemKey is instead a
freemarker.ext.beans.BooleanModel






-Jason

Re: struts 2.0.7 template/simple/select.ftl error/fix

Posted by Jason Thurston <ja...@gmail.com>.
I'm not yet setup subversion so I did not create a patch.  I did just report
the issue to  JIRA, issue number (WW-1887)

On 4/17/07, Martin Gainty <mg...@hotmail.com> wrote:
>
> Jason
>
> Thanks for the fix
> Did you commit the patch?
>
> Martin--
> This email message and any files transmitted with it contain confidential
> information intended only for the person(s) to whom this email message is
> addressed.  If you have received this email message in error, please
> notify
> the sender immediately by telephone or email and destroy the original
> message without making a copy.  Thank you.
>
> ----- Original Message -----
> From: "Jason Thurston" <ja...@gmail.com>
> To: <us...@struts.apache.org>
> Sent: Tuesday, April 17, 2007 3:56 PM
> Subject: struts 2.0.7 template/simple/select.ftl error/fix
>
>
> > To fix I extracted template/simple/select.ftl from the
> > struts2-core-2.0.7.jar to WEB-INF/classes/template/simple/select.ftl
> >
> > I then
> > changed line 60 from:
> >    <option value="${itemKey?html}"<#rt/>
> > to:
> > <option value="${itemKeyStr?html}"<#rt/>
> >
> > and I inserted the following line before line 60:
> > <#assign itemKeyStr=itemKey.toString() />
> >
> > I got the idea from another .ftl file that does something similar.
> >
> >
> > The error message this fixed was:
> >
> > Error on line 60, column 22 in template/simple/select.ftl
> > Expecting a string, date or number here, Expression itemKey is instead a
> > freemarker.ext.beans.BooleanModel
> > The problematic instruction:
> >
> > ----------
> > ==> ${itemKey?html} [on line 60, column 20 in
> template/simple/select.ftl]
> > in user-directive s.iterator [on line 41, column 1 in
> > template/simple/select.ftl]
> > ----------
> > Java backtrace for programmers:
> > ----------
> > freemarker.core.NonStringException: Error on line 60, column 22 in
> > template/simple/select.ftl
> > Expecting a string, date or number here, Expression itemKey is instead a
> > freemarker.ext.beans.BooleanModel
> >
> >
> >
> >
> >
> >
> > -Jason
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Jason Thurston

Re: struts 2.0.7 template/simple/select.ftl error/fix

Posted by Martin Gainty <mg...@hotmail.com>.
Jason

Thanks for the fix
Did you commit the patch?

Martin--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: "Jason Thurston" <ja...@gmail.com>
To: <us...@struts.apache.org>
Sent: Tuesday, April 17, 2007 3:56 PM
Subject: struts 2.0.7 template/simple/select.ftl error/fix


> To fix I extracted template/simple/select.ftl from the
> struts2-core-2.0.7.jar to WEB-INF/classes/template/simple/select.ftl
> 
> I then
> changed line 60 from:
>    <option value="${itemKey?html}"<#rt/>
> to:
> <option value="${itemKeyStr?html}"<#rt/>
> 
> and I inserted the following line before line 60:
> <#assign itemKeyStr=itemKey.toString() />
> 
> I got the idea from another .ftl file that does something similar.
> 
> 
> The error message this fixed was:
> 
> Error on line 60, column 22 in template/simple/select.ftl
> Expecting a string, date or number here, Expression itemKey is instead a
> freemarker.ext.beans.BooleanModel
> The problematic instruction:
> 
> ----------
> ==> ${itemKey?html} [on line 60, column 20 in template/simple/select.ftl]
> in user-directive s.iterator [on line 41, column 1 in
> template/simple/select.ftl]
> ----------
> Java backtrace for programmers:
> ----------
> freemarker.core.NonStringException: Error on line 60, column 22 in
> template/simple/select.ftl
> Expecting a string, date or number here, Expression itemKey is instead a
> freemarker.ext.beans.BooleanModel
> 
> 
> 
> 
> 
> 
> -Jason
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org