rendering JSON with Grails?

后端 未结 2 1194
南笙
南笙 2021-01-24 16:50

I tried to find a cool guide how rendering JSON with Grails works, the documentation on official website - to me - very little information.

which articles you used tha

2条回答
  •  清歌不尽
    2021-01-24 17:17

    I think this documentation is sufficient. You install the converters plugin and then render the response object as json:

    def list = {
        def listResult = [ total: Book.count(), items: Book.list(params)]
        render listResult as JSON
    }
    

提交回复
热议问题