title: JSP displays null values despite having data
body: <p>I have this data passed to JSP from servlet:</p>
  
  <pre><code>[
      Document {
          {_id=59d25b1e41affc3dbc3b47c4, name=John, address=Baker Street}
      }, 
      Document {
          {_id=59d2a67541affc33ccc98a0b, name=John, address=Baker Street}
      }
  ]
  </code></pre>
  
  <p>The JSP file.</p>
  
  <pre><code>&lt;table&gt;
      &lt;c:forEach items="${NameList}" var="document"&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;c:out value="${document.string('name')}" escapeXml="true" /&gt;&lt;/td&gt;   
              &lt;td&gt;&lt;c:out value="${document.string('address')}" escapeXml="true" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/c:forEach&gt; 
  &lt;/table&gt;
  </code></pre>
  
  <p>But, I am not getting any value displayed in my JSP.</p>
  
  <p>Could someone help me figure out the mistake that I am doing?</p>
  
  <p>EDIT:</p>
  
  <p>This is my query which searches for the fields in MOngoDb using the keyword:</p>
  
  <pre><code>    List&lt;Document&gt; NameList= collection.find(eq("name", fname)).into(new ArrayList&lt;Document&gt;());
  </code></pre>
  
  <p>the Document is from org.bson.Document</p>
  
  <p>I sent this to JSP using the following code:</p>
  
  <pre><code>     request.setAttribute("NameList", NameList);
       request.getRequestDispatcher("main.jsp").forward(request, response);
  </code></pre>
  
  <p>Then in the main.jsp, I have the code that is given before this edit section.</p>
  
  <p>Since I am new to both JSP, servlet and MongoDB I do not understand how I can extract the exact data like name, address from the list that I pass.</p>