function saveReportData(fileName,fileID) {
console.log("fileName="+fileName);
$.ajax({
type : 'post',
url : '${ctx}/reportmanage/specialReportManage/saveReportData',
data:{'srFileName':fileName,"srFileID":fileID},
traditional : true,
async : false,
success : function(result){
},
error : function(result){
}
});
}
接收方式兩種
- 說明:ajax的data參數名稱(紅色標識)必須和@RequestParam中的參數名稱保持一致
- @RequestMapping(value = "saveReportData")
- @ResponseBody
public String saveReportData(@RequestParam(value = "srFileName", defaultValue = "") String FileName,
@RequestParam(value = "srFileID", defaultValue = "") String FileID) throws IOException {
specialReportManageService.saveReportData(FileName, FileID);
return "";
}
- 說明:如果沒有添加@RequestParam,函數的參數名稱必須和ajax中的參數名稱一致
- public String saveReportData( String srFileName,String srFileID) throws IOException {
specialReportManageService.saveReportData(FileName, FileID);
return "";
}
