I'm using renderJSON() method to return an array of objects, with a custom JsonSerializer for the class of each element. The response has the following format:
[{"id":2,"name":"fred"},{...},...]
But I would like to add the name of the array at the begginning:
"arrayname":[{"id":2,"name":"fred"},{...},...]
How can I add the name of the object to a JSON response with renderJSON()? Should I use a template or can I do it with java code?