Re: Issue 6 in json-template: Java version available

29 views
Skip to first unread message

json-t...@googlecode.com

unread,
Jan 19, 2011, 6:22:17 AM1/19/11
to json-t...@googlegroups.com

Comment #6 on issue 6 by matias...@gmail.com: Java version available
http://code.google.com/p/json-template/issues/detail?id=6

Hi, I just downloaded the Java implementation and I plan to start using it
on a real project.
If you don't mind, I would like to reorganize the package structure and I'm
happy to contribute with the TODOs.

I'll let you know how it goes.

Cheers!

json-t...@googlecode.com

unread,
Jan 19, 2011, 7:25:53 AM1/19/11
to json-t...@googlegroups.com

Comment #7 on issue 6 by matias...@gmail.com: Java version available
http://code.google.com/p/json-template/issues/detail?id=6

I tried to run Test.java using the attached file and I got the following
Exception:

EXCEPTION: EvaluationError
jsontemplate.EvaluationError: pushSection called when current cursor value
is not a map (is:
{ "url-base": "http://example.com/music/", "playlist-name": "Epic
Playlist", "songs": [
{ "url": "1.mp3", "artist": "Grayceon", "title": "Sounds
Like Thunder" },
{ "url": "2.mp3", "artist": "Thou", "title": "Their
Hooves Carve Craters in the Earth" } ] })
at jsontemplate.ScopedContext.pushSection(ScopedContext.java:22)
at jsontemplate.SectionStatement.execute(SectionStatement.java:14)
at jsontemplate.TemplateExecutor.execute(TemplateExecutor.java:10)
at jsontemplate.Template.render(Template.java:52)
at jsontemplate.Template.expand(Template.java:65)
at jsontemplate_test.Test.main(Test.java:65)


The contents of the template and the dictionary are exactly what is shown
as example in the intro page.
Can you give me a hint on what I am doing wrong?

Thanks!


Attachments:
songs.json 729 bytes

json-t...@googlecode.com

unread,
Jan 24, 2011, 1:49:32 AM1/24/11
to json-t...@googlegroups.com

Comment #8 on issue 6 by william....@gmail.com: Java version available
http://code.google.com/p/json-template/issues/detail?id=6

Hi Matias, the dictionary's value is supposed to be an actual dictionary,
not a string representation of a dictionary, so:

"dictionary": {"url-base": "...", "playlist-name": "...", "songs": [ {...}
] }

that should work.

Hope this helps,
William

Reply all
Reply to author
Forward
0 new messages