I have problem gatting the data from sevlet by using sAjaxsource??

I have problem gatting the data from sevlet by using sAjaxsource??

Pinja_RajaPinja_Raja Posts: 2Questions: 0Answers: 0
edited August 2013 in DataTables 1.9
Here I am posting my JSP and Servlet code snippets

var oTable = $("#webExcelTool").dataTable({
"sPaginationType" : "full_numbers",
// "sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "media/swf/copy_csv_xls_pdf.swf"
},
"bJQueryUI" : true,
"sDom": 'T<"clear"><"H"lfr>t<"F"ip>',
"bProcessing": true,
"bServerSide": true,
"iDisplayLength": 10,
//"bDeferRender": true,
"sAjaxSource": "<%=request.getContextPath()%>/sAjaxsourceServlet",
"fnServerData": function (sSource, aoData, fnCallback) {
$.ajax( {
"dataType": 'json',
"type": 'POST',
"url": sSource,
"data": aoData,
"success": fnCallback,
"error": function(jqXHR, textStatus, errorThrown) {
console.log(txtStatus, errorThrown); // use alert() if you prefer
}
} );
}
} );

in the servlet I'm doing this and can able to navigate till the end of servlet successfully but ...my jsp page still shows processing and loading
JsonElement element = gson.toJsonTree(alExcelDataRows,
new TypeToken() {
}.getType());
JsonArray aoData = element.getAsJsonArray();
System.out.println("jsonArray == " + aoData);
response.setContentType("application/json");
response.setCharacterEncoding("UTF-8");
//response.getWriter().print(jsonArray);
response.getWriter().write(new Gson().toJson(aoData));

Replies

This discussion has been closed.