Created
December 13, 2013 12:34
-
-
Save mlist/7943608 to your computer and use it in GitHub Desktop.
grails with jackson
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def criteria = SomeDomainClass.createCriteria() | |
def result = criteria.list { | |
... | |
} | |
ObjectMapper mapper = new ObjectMapper() | |
def jsonResult = mapper.writeValueAsString(result) | |
response.contentType = "text/json" | |
render jsonResult |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment