I am working on a REST interface where people get a json file. The client must access the file from another domain. I am using jsonp, which still works. My problem is rendering in Grails. I am currently using "as JSON" to sort the object:
render "${params.jsoncallback}(${user as JSON})"
Access to the client of the Json file includes all attributes, including id and the class that I do not want to have there. If this is not jsonp, I do it so that works fine:
render(contentType:'text/json'){
userName user.userName
userImage user.userImage
:
:
}
So, how do I get the id and class attributes from json when rendering "user as JSON"? Any idea?
Best regards, Klaas
Klaas