title: populate a table with thymeleaf with very large registers or data
body: <p>hi i am working in a spring mvc project using thymeleaf and i have a method that executes a very complex query that takes <code>7 seconds</code> to return 1500 rows, i have to populate a table with that data using thymeleaf, but its taking too much time populating the table, it takes 1 min to populate the table and show the web page, so it takes 1 min loading the page, is there a way to populate a table when you have a lot of data without taking too much time??</p>
  
  <p>i used to think that it was taking too much time loading was because my method returns a list Objects and i need to cast that list of objects to my proper POJO object so i have to loop the list and cast each object, </p>
  
  <p>but its not that because i try the following tests</p>
  
  <p>1) i try printing the list objects in a simple TextArea without the casting method and it printed me all the Objects, it took <code>9 secs</code> to show the web page but you need to take out the 7 seconds that took the query to bring the data</p>
  
  <p>it printed like 1000 objects like this in my textArea: </p>
  
  <p>[Ljava.lang.Object;@e9548,[Ljava.lang.Object;@e9548..... </p>
  
  <p>2) i try printing the list in a simple TextArea with my method that cast each object to my POJO objects and it took  <code>10 secs</code> almost the same time that it took when i printed the raw object list without my cast method</p>
  
  <p>it printed like 1000 objects like this in my textArea:  <code>com.abc.serviceClass.Person@252c46, com.abc.serviceClass.Person@252c46,  com.abc.serviceClass.Person@252c46, com.abc.serviceClass.Person@252c46.....</code></p>
  
  <p>3) this is why i think that the method that use thymeleaf to populate the table have the fault of the web page taking almost <code>1 min to load</code>, Becasue when i populate my table using this code </p>
  
  <pre><code>&lt;table&gt;
      &lt;tbody&gt;
            &lt;tr th:each="nodeInfo : ${listOfPojos}"&gt;
  
                                              &lt;td th:text="${nodeInfo.name}"&gt;&lt;/td&gt;
  
                                              &lt;td th:text="${nodeInfo.lastName}"&gt;&lt;/td&gt;
          &lt;/tr&gt;  
  
  
  
       &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>that <code>th:each</code> that have to iteare the 1500 registers that are in my listOfPojos and print the value i believe is why is taking too much time it takes more than 1 min to show my web page when i put that code, thats why i wanted to ask if its another way to populate my table using that list of 1500 pojos objects without taking that whole minute to show the page.</p>