Re: Specifying a list literal as hash item value

Albert Kam <[email protected]> Tue, 10 Nov 2015 23:29:32 +0700
Newsgroups gmane.comp.web.freemarker.user
Message-ID <CAMT20g_k0o6NyVbxVEgdk1pWvShipKCw5x=w+WLp+Q3U72eFNg@mail.gmail.com>
--===============7842204630650512041==
Content-Type: multipart/alternative; boundary=001a11358e54f6a8330524323614

--001a11358e54f6a8330524323614
Content-Type: text/plain; charset=UTF-8

Ah, thanks so much!

On Tuesday, November 10, 2015, Lee <[email protected]> wrote:

> It needs to be in a JSON-like format.
>
> <#assign test = {
>     "hello": ["hello world"]
> }>
>
> On Tuesday, November 10, 2015, Albert Kam <[email protected]
> <javascript:_e(%7B%7D,'cvml','[email protected]');>> 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)

--001a11358e54f6a8330524323614
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Ah, thanks so much!<br><br>On Tuesday, November 10, 2015, Lee &lt;<a href=
=3D"mailto:[email protected]">[email protected]</a>&gt; wrote:<br><bl=
ockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #=
ccc solid;padding-left:1ex">It needs to be in a JSON-like format.=C2=A0<div=
><br></div><div>&lt;#assign test =3D {</div><div>=C2=A0 =C2=A0 &quot;hello&=
quot;: [&quot;hello world&quot;]</div><div>}&gt;<br><br>On Tuesday, Novembe=
r 10, 2015, Albert Kam &lt;<a href=3D"javascript:_e(%7B%7D,&#39;cvml&#39;,&=
#39;[email protected]&#39;);" target=3D"_blank">moonblade.wolf@gmail=
.com</a>&gt; wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 =
0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">I tr=
ied to specify a list literal as hash item value like this,<div><div><br></=
div><div>&lt;#assign test=3D{</div><div><span style=3D"white-space:pre-wrap=
">	</span>hello=3D[ &#39;hello world&#39; ]</div><div>}&gt;</div><div><br><=
/div><div>And i got this exception:</div><div><div>java.lang.RuntimeExcepti=
on: freemarker.core.ParseException: Syntax error in template &quot;my.cfg&q=
uot; in line 2713, column 15:</div><div>Found list literal: [&quot;hello wo=
rld&quot;]. Expecting scalar</div><div><span style=3D"white-space:pre-wrap"=
>	</span>at app.cfg.Manager.interpolatedCfg(Manager.java:111)</div><div><br=
></div></div><div><span style=3D"white-space:pre-wrap">Is this not supporte=
d ?</span><br></div><div><span style=3D"white-space:pre-wrap"><br></span></=
div>-- <br><div>Do not pursue the past. Do not lose yourself in the future.=
 <br>The past no longer is. The future has not yet come. <br>Looking deeply=
 at life as it is in the very here and now, <br>the practitioner dwells in =
stability and freedom.<br>(Thich Nhat Hanh)</div>
</div></div>
</blockquote></div>
</blockquote><br><br>-- <br>Do not pursue the past. Do not lose yourself in=
 the future. <br>The past no longer is. The future has not yet come. <br>Lo=
oking deeply at life as it is in the very here and now, <br>the practitione=
r dwells in stability and freedom.<br>(Thich Nhat Hanh)<br>

--001a11358e54f6a8330524323614--


--===============7842204630650512041==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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

--===============7842204630650512041==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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

--===============7842204630650512041==--