aoData push and servlet
aoData push and servlet
datatblusr
Posts: 2Questions: 0Answers: 0
I'm trying to push data to the servlet using aoData but its not working. Not sure what is wrong here.
[code]
oTable1 =
$("#mytablesorter1").dataTable({
"sDom": 'rt<"bottom"plf>',
sPaginationType: "full_numbers",
bStateSave: true,
"bServerSide": false,
"sAjaxSource": "/servlet1/srv",
"fnServerData": function(sSource, aoData, fnCallback) {
aoData.push( {"name":"myname", "value":"myvalue"} );
$.getJSON( sSource, aoData, function (json){
fnCallback(json)
});
}
});
[/code]
[code]
servlet code:
String name = request.getParameter("name");
String value = request.getParameter("value");
[/code]
[code]
oTable1 =
$("#mytablesorter1").dataTable({
"sDom": 'rt<"bottom"plf>',
sPaginationType: "full_numbers",
bStateSave: true,
"bServerSide": false,
"sAjaxSource": "/servlet1/srv",
"fnServerData": function(sSource, aoData, fnCallback) {
aoData.push( {"name":"myname", "value":"myvalue"} );
$.getJSON( sSource, aoData, function (json){
fnCallback(json)
});
}
});
[/code]
[code]
servlet code:
String name = request.getParameter("name");
String value = request.getParameter("value");
[/code]
This discussion has been closed.
Replies
[code]String name = request.getParameter("myname");[/code]
from
[code]String name = request.getParameter("name");[/code]
Remove the line:
[code]String value = request.getParameter("value");[/code]