function Adddebtresult () {varrepayids=$ ("#repayIds"). Val (); varlatefeeday=$ ("#repayIds1"). Val (); varsubadminid1=$ ("#subAdminId1"). Val (); if(subadminid1==NULL|| subadminid1=="") {alert ("No collection personnel selected! "); return; } $('#bt_flash'). attr ('Data-dismiss','modal'); $.ajax ({type:"Post", timeout:30000, Async:false, Cache:false, data:{"Repayids": Repayids,"Latefeeday": Latefeeday,"Subadminid": SubAdminId1,}, URL:"${ctx}/postloanmanagecontroller/addtaskallocat", Success:function (data) {if(data==1) {location.reload (); Alert ("Add success! "); }Else if(data==3) {alert ("Please login! "); Window.location.href="${ctx}/admin"; }Else{alert ("Add failed"); } } }); }
//Collection Management: task assignments-add assignment Records@ResponseBody @RequestMapping (value="/addtaskallocat", produces="Application/json;charset=utf-8") Public intaddtaskallocat (String repayids,string latefeeday, string subadminid,httpservletrequest request) {Logbefore (Logger,"Collection Management: task assignments-add assignment Records"); Admin Admin=getcurrentadmin (Request); if(admin==NULL){ return 0; } intFlag =Postloanmanageservice.addtaskallocat (Repayids, Latefeeday, subadminid,admin); Logafter (logger); returnFlag; }
The implementation of Ajax in SPRINGMVC