Wednesday, March 25, 2015

Grails JSON encoding applyCodec

I had some data that I wanted to render in the GSP page, however, by default single quotes were being encoded as


To prevent grails from encoding your output, wrap it in the undocumented  applyCodec tag as follows:

var selectedItems = <g:applyCodec encodeAs="none">${data as grails.converters.JSON}</g:applyCodec>


No comments:

Post a Comment