Rendering JSON in grails

后端 未结 3 512
余生分开走
余生分开走 2021-02-02 13:06

I use the following code to render data in JSON format.

render(contentType:\"text/json\") {
    results = array {
        db.eachRow(query) { row ->
                  


        
3条回答
  •  醉话见心
    2021-02-02 13:46

    This should be enough to render a JSON from controller:

    render results as grails.converters.JSON
    

提交回复
热议问题