Quantcast

Specifying a list literal as hash item value

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Specifying a list literal as hash item value

Albert Kam
I tried to specify a list literal as hash item value like this,

<#assign test={
hello=[ 'hello world' ]
}>

And i got this exception:
java.lang.RuntimeException: freemarker.core.ParseException: Syntax error in template "my.cfg" in line 2713, column 15:
Found list literal: ["hello world"]. Expecting scalar
at app.cfg.Manager.interpolatedCfg(Manager.java:111)

Is this not supported ?

--
Do not pursue the past. Do not lose yourself in the future.
The past no longer is. The future has not yet come.
Looking deeply at life as it is in the very here and now,
the practitioner dwells in stability and freedom.
(Thich Nhat Hanh)

------------------------------------------------------------------------------

_______________________________________________
FreeMarker-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
Lee
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Specifying a list literal as hash item value

Lee
It needs to be in a JSON-like format. 

<#assign test = {
    "hello": ["hello world"]
}>

On Tuesday, November 10, 2015, Albert Kam <[hidden email]> wrote:
I tried to specify a list literal as hash item value like this,

<#assign test={
hello=[ 'hello world' ]
}>

And i got this exception:
java.lang.RuntimeException: freemarker.core.ParseException: Syntax error in template "my.cfg" in line 2713, column 15:
Found list literal: ["hello world"]. Expecting scalar
at app.cfg.Manager.interpolatedCfg(Manager.java:111)

Is this not supported ?

--
Do not pursue the past. Do not lose yourself in the future.
The past no longer is. The future has not yet come.
Looking deeply at life as it is in the very here and now,
the practitioner dwells in stability and freedom.
(Thich Nhat Hanh)

------------------------------------------------------------------------------

_______________________________________________
FreeMarker-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Specifying a list literal as hash item value

Albert Kam
Ah, thanks so much!

On Tuesday, November 10, 2015, Lee <[hidden email]> wrote:
It needs to be in a JSON-like format. 

<#assign test = {
    "hello": ["hello world"]
}>

On Tuesday, November 10, 2015, Albert Kam <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;moonblade.wolf@gmail.com&#39;);" target="_blank">moonblade.wolf@...> wrote:
I tried to specify a list literal as hash item value like this,

<#assign test={
hello=[ 'hello world' ]
}>

And i got this exception:
java.lang.RuntimeException: freemarker.core.ParseException: Syntax error in template "my.cfg" in line 2713, column 15:
Found list literal: ["hello world"]. Expecting scalar
at app.cfg.Manager.interpolatedCfg(Manager.java:111)

Is this not supported ?

--
Do not pursue the past. Do not lose yourself in the future.
The past no longer is. The future has not yet come.
Looking deeply at life as it is in the very here and now,
the practitioner dwells in stability and freedom.
(Thich Nhat Hanh)


--
Do not pursue the past. Do not lose yourself in the future.
The past no longer is. The future has not yet come.
Looking deeply at life as it is in the very here and now,
the practitioner dwells in stability and freedom.
(Thich Nhat Hanh)

------------------------------------------------------------------------------

_______________________________________________
FreeMarker-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
Loading...