title: get value form json object
body: <p>I have a code which gets <code>List</code> of objects using Hibernate from db. One of the fields of object has XML format. I get that field value using this code in <code>jsp</code> file:</p>
  
  <pre><code>for(PluginMonitor pm : list ) {
      // parsing xml to json
      JSONObject metricsFieldValue = org.json.XML.toJSONObject(pm.getMetrics());
      Object metricMetric = metricsFieldValue.get("metric");      
  }
  </code></pre>
  
  <p>output of <code>metricsFieldValue</code> is </p>
  
  <pre><code>{
      "metric": [
          {
              "defaultThreshold": "0",
              "preselected": "true",
              "uom": "B/sec",
              "name": "BytesReceivedPersec",
              "type": "integer",
              "displayName": "Input Traffic"
          },
          {
              "defaultThreshold": "0",
              "preselected": "true",
              "uom": "B/sec",
              "name": "BytesSentPersec",
              "type": "integer",
              "displayName": "Output Traffic"
          }
      ]
  }
  </code></pre>
  
  <p>so output  of <code>metricMetric</code> is an Array, But I need only <code>displayName</code> and <code>name</code> of each object in that array. Any ideas how to get these values.</p>