title: How to get an attribute from a JSONObject in a jsp with Struts2?
body: <p>I have the following situation:</p>
  
  <pre><code>  &lt;s:iterator var="doc" value="docList"&gt;
      &lt;tr&gt;
         &lt;td class="lastm"&gt;${doc.get("attribute")}&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/s:iterator&gt;
  </code></pre>
  
  <p><code>docList</code> is an ArrayList of JSONObjects.  </p>
  
  <p>When I load my page I get the following error:</p>
  
  <blockquote>
    <p>The function get must be used with a prefix when a default namespace is not specified</p>
  </blockquote>
  
  <p>I've also tried doing<br>
      <code>&lt;td class="lastm"&gt;${doc.attribute}&lt;/td&gt;</code></p>
  
  <p>but then I get the following error instead:  </p>
  
  <blockquote>
    <p>Property 'attribute' not found on type org.json.JSONObject</p>
  </blockquote>
  
  <p>What am I doing wrong? 
  The ArrayList has been originally built from a bigger JSONObject that contained the smaller "docs", but I needed an Iterable object to build my table. Is there a better way to do this? </p>