我在Spring Boot中使用datatable.js。我的问题是我无法将单独的post参数发送到控制器。 下面是我的jQuery函数
$feeScheduleTable = $('#fee_schedule').DataTable({
ajax: {
contentType: 'application/json',
url: '/programFee1',
type: 'POST',
"async": true,
dataSrc: function (d) {
return JSON.stringify(d);
},
data: parameters,
},
serverSide: true,
"bDestroy": true,
serverData: {
programId: 'Awais'
},
columns: [
{
data: 'id'
},
{
data: 'fixRate'
},
{
data: 'percentage'
},
{
data: 'fixRate'
},
{
data: 'percentage'
}
]
});
这是我的控制器功能
@RequestMapping(value = "/programFee1", method = RequestMethod.POST)
public DataTablesOutput<ProgramFee> getPGM (@RequestParam(value =
"programId", required = true) String programId,
@Valid @RequestBody DataTablesInput input)
{
DataTablesOutput<ProgramFee> programFeeDataTablesOutput =
programFeeRepository.findAll (input);
return programFeeDataTablesOutput;
}
请帮助。谢谢