When writing a domain object via JSON to a response in a controller, is there a way to prevent certain fields from be written? Most examples show the entire domain object being written in a controller method via render().
What I did is I used the JSON markup builder syntax to only write the fields I want written to the client. But it's ... well ... ugly I think. I hate that nagging feeling I am missing something simple... :)
The original service I am rewriting in GRAILS used the Jackson JSON library and you could annotate fields to be excluded...
Cheers
---------------------------------------
Jeff Gortatowsky, Fullerton, CA | Twitter: JeffGortatowsky
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email