title: JSP/JSTL - Iterating through a JSONArray with nested JSON Objects
body: <p>This is how my current JSONArray is constructed:</p>
  
  <pre><code>{ "exams":[
      { 0:[
          { 0:[
              { "URL": "www.google.com",
                "Date": "July 26, 2017",
                "Heading": "Google"
              },
              { "URL": "www.yahoo.com",
                "Date": "July 27, 2017",
                "Heading": "Yahoo"
              }]
          }]
      }]
  }
  </code></pre>
  
  <p>Right now, I am trying to iterate through this by creating links with the heading as the title/text of the a tag.</p>
  
  <p>So far this is what I have:</p>
  
  <pre><code>&lt;c:forEach var="exam" items="${exams}" varStatus="counter"&gt;
      &lt;c:if test="${!empty exams}"&gt;
      &lt;div id="exams${counter.count-1}"&gt;
          &lt;a href="${exam.URL}" target="_blank" title="&lt;c:out value="${exam.Date}" /&gt;" &lt;/a&gt;
          &lt;p&gt;exam.Heading&lt;/p&gt;
      &lt;/div&gt;
      &lt;/c:if&gt;
  &lt;/c:forEach&gt;
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p><strong>UPDATE: Answer below</strong></p>
  
  <p>Managed to get it working by simply doing all the value grabs with a single forEach statement:</p>
  
  <pre><code>&lt;c:forEach var="exam" items="${exams}" varStatus="counter"&gt;
      &lt;div id="exams"&gt;
          &lt;a href="${exam.URL}" target="_blank" title="&lt;c:out value="${exam.Date}" /&gt;"&gt;
              &lt;c:out value="${exam.Date}" /&gt;
          &lt;/a&gt;
          &lt;p&gt; &lt;c:out value="${exam.Heading}" /&gt; &lt;/p&gt;
      &lt;/div&gt;
  &lt;/c:forEach&gt;
  </code></pre>