SORRY: This is my bad. This error is due incorrect json produce and to Chrome extension “JSONView in Chrome”. See my own answer (I had to answer this myself – as I could not delete the question anymore).
I am using Velocity (Maven version 1.7 of org.apache.velocity) as templating engine, and I want output as follows:
{
total : 234
}
now when I try:
{
total : $listing.size()
}
I get an error:
Error: Parse error on line 1:
{ total : 0}
--^
Expecting 'STRING', '}'

and when I try to escape the curly braces:
\{
total : $listing.size()
\}
I get the escape characters in the final output!:
\{
total : 234
\}
Sorry this was due incorrect JSON I was producing, which Chrome browser’s extension “JSONView” pointed out to me. This was because my keys were not strings… i.e. I had:
but I should’ve had: