user7047891 user7047891 - 9 months ago 58
Groovy Question

How to iterate below json in grails gsp page to get each correspondance label and value



You have to parse it in the server-side:

// Parse the JSON
def list = new JsonSlurper().parseText(jsonString)

Then send it to your gsp and iterate as a regular map

<g:each in="${list}">
    <p>Label: ${it.label}</p>
    <p>Value: ${it.value}</p>