DataTables JSTL/EL support

DataTables JSTL/EL support

BenignReaverBenignReaver Posts: 24Questions: 5Answers: 0

My question is simple;

can I populate the table with JSTL and Expression Language in a JSP page? My table requires pulling from a database which is 500,000 records & growing.

Looking at your examples I see that table data can be loaded via AJAX or Hard-Coded, but here's how the current system works:

<c:forEach items="${tblRslt}" var="put">
   <tr>
         <td>${put.getCol1()}</td>
         <td>${put.getCol2()}</td>
         <td>${put.getCol3()}</td>
         <td>${put.getCol4()}</td>
         <td>${put.getCol5()}</td>
    </tr>
</c:forEach>

Can I use this here?

This question has accepted answers - jump to:

Answers

  • BenignReaverBenignReaver Posts: 24Questions: 5Answers: 0

    I should note, ${put.getColx()} refers to an ArrayList element within a Java Servlet, passed as a request attribute (tblRslt).

  • allanallan Posts: 63,680Questions: 1Answers: 10,498 Site admin
    Answer ✓

    If that template is creating a static HTML table, then sure, DataTables will read that just fine since it will run after the page has been rendered by the server.

    500k rows is a lot of data to have in a static table though!

    Allan

  • BenignReaverBenignReaver Posts: 24Questions: 5Answers: 0

    The application feeds from a MySQL Database which is edited periodically.

    Since this page is directed to via JavaServlets, the content is loaded and sent to the request view before the page is rendered, I didn't think this would be an issue.

    You are right, 500k is a lot of data, but this is for a customer project and they are adamant they want everything visible in the browser.

  • BenignReaverBenignReaver Posts: 24Questions: 5Answers: 0

    I haven't managed to get this working and it's getting to the stage where I either get this working, or find a new job.

    Tomcat isn't throwing any exceptions and the entire table is loading. ALL resources are in their correct places (i have up on trying the CDNs).

    Chrome Developer Tools & Firefox Firebug are not showing any errors and all tags are closed. I can't understand what the issue is

  • allanallan Posts: 63,680Questions: 1Answers: 10,498 Site admin

    they want everything visible in the browser.

    At a time?! Or can it be paged? If it can be paged, take a look at server-side processing which can handle millions of rows.

    Can you link to the page so it can be debugged? I currently don't know what the issue is (other than not working).

    Allan

  • BenignReaverBenignReaver Posts: 24Questions: 5Answers: 0

    Sorry for the late reply...

    It can be paged, i have a feeling that showing everything will crash the browser.

    Unfortunately I can't link to the page as it's not public domain, and would breach my employment & our customer contract

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    It can be paged

    So did you look at server-side processing?

  • BenignReaverBenignReaver Posts: 24Questions: 5Answers: 0

    I did, and possibly because i'm dumb, I've not seen scope for Java. The solution is to be based on Java Servlets hosted on Apache Tomcat

  • allanallan Posts: 63,680Questions: 1Answers: 10,498 Site admin
    Answer ✓

    Yes, you would need to implement a script that communicates with DataTables using its the server-side processing protocol. The protocol is fully documented for you to be able to do so.

    Allan

This discussion has been closed.