Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use JQuery Datatable with JSP properly?

I want to use Datatable-Plugin of JQuery with JSP. How does the main approach look like?

I want to load the Datatable with AJAX. But my question is how to do it in general with JSP. Normally I'm using JSF with Primefaces but this is much simpler as to do it with JSP (I don't need any Javascript code to use JQuery-Datables example for non-believers).

like image 750
John N Avatar asked Oct 03 '22 01:10

John N


1 Answers

You would need to do two specific things:

  1. Create your jsp handler to take a.offset b.pagelength, and make it render json. Lets say you are at this point now (whre you have a variable JSON_DATA)
  2. Use code similar to this pipelined ajax example to make jquery datatables work with your pagination style.

Also, IMO this is a valid question. So UPVOTE.

like image 141
Neeraj Avatar answered Oct 12 '22 23:10

Neeraj