title: How to populate a hidden HTML table with the result from the database?
body: <p>I have a JSP called <code>create-account.jsp</code> which collects a customer's details and sends the data to a Servlet. The Servlet inserts the customer's data into the database, queries the database add sets the results as request scoped attributes and the dispatches to <code>create-account.jsp</code>(same jsp). Now the inserted details must appear in a hidden html table in the jsp. How do I do it? Can any one help?</p>
  
  <p>create-account.jsp</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
      &lt;title&gt;Create New Account&lt;/title&gt;
      &lt;style&gt;
          a {
              text-decoration: none;
          }
  
          body {
              border-color: azure;
          }
  
      &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;p align="right"&gt;Hi, ${sessionScope.user.userName} &lt;a
          href="${pageContext.servletContext.contextPath}/logOut.do"&gt;logout&lt;/a&gt;&lt;/p&gt;
  
  
  &lt;h2 align="center"&gt;Create New Account&lt;/h2&gt;
  
  &lt;form action="${pageContext.request.contextPath}/create.do" method="post"&gt;
      &lt;table border="1" align="center"&gt;
          &lt;tr&gt;
              &lt;td&gt;Name:&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="name"&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;DOB:(yyyy-mm-dd)&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="dob"&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Balance:&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="balance"&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td align="center" colspan="2"&gt;
                  &lt;input type="submit" value="Create" name="create"&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/form&gt;
  &lt;p align="center" style="display: none"&gt;${requestScope.result} has been successfully inserted into the table&lt;/p&gt;
  &lt;table id="hiddenTable" style="display: none" border="1"&gt;
      &lt;tr&gt;
          &lt;td&gt;
  
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>