user7047891 user7047891 - 1 year ago 89
Groovy Question

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


Answer Source

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>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download