jQuery DataTables server-side processing with Java -
i looking how implement jquery datatables server-side processing in java. have tried following way using below parameters. below jquery ready
function code.
$(document).ready(function() { //url = http://localhost:8080/jquery-datatable-java-integration/serverexample $('#mytableid').datatable({ "serverside" : true, "processing" : true, /*"bprocessing" : true, "bserverside" : true,*/ "ajax" : { "url" : "serverexample", "type" : "post" }, "columns" : [ { "data" : "phone number" }, { "data" : "name" }, { "data" : "email" } ] }); });
in servlet dopost() method request parameter secho null.
protected void dopost(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { logger.info("in post method of server servlet.."); logger.info("secho request parameter = " + request.getparameter("secho"));//returning null //other code here }
my jquery datatables version 1.10.7. parameters should used, serverside
or bserverside
, tried both ways, still same. latest updated working example references helpful.
when using datatables 1.10 version in server-side processing mode, client side sends draw
parameter along other parameters. full list shown on datatables website.
previous version of datatables 1.9 used secho
parameter in server-side processing mode, see documentation more information.
if have server-side script written datatables 1.9, possible force datatables 1.10 send parameters compatible previous version. below excerpt manual:
older versions of datatables (1.9-) used different set of parameters send , receive server. such scripts written datatables 1.10+ not able function datatables 1.9-. however, datatables 1.10 have compatibility mode scripts written 1.9-. compatibility mode triggered use of old
sajaxsource
parameter (rather newajax
parameter) or setting$.fn.datatable.ext.legacy.ajax = true;
.
you should using serverside
, processing
preferred option names version 1.10 although accepts option names (bserverside
, bprocessing
) previous version well.
Comments
Post a Comment