POST link 400 (Bad Request)
I'm getting this error when trying to send 2 array's to my Spring controller, however I'm getting this error, I tried some solutions I found in SOen but I did not succeed. The version of my Spring is 3.0.2.
JS Code
var url = '/app/workflow/execute/';
$.ajax({
url: url,
type: 'POST',
dataType: 'json',
data: {
processName : pName,
argumentsNameArray : argumentsNameArr,
argumentsValArray : argumentsValArr
},
})
.done(function(data) {
console.log(data);
});
Java code
@RequestMapping(value = "/workflow/execute/", method = RequestMethod.POST)
@ResponseBody
public WorkflowProcess executeWFProccess(
@PathVariable("processName") String processName,
@PathVariable("argumentsNameArray[]") String[] argumentsNameArray,
@PathVariable("argumentsValArray[]") String[] argumentsValArray) {
WorkflowProcess wfProcess = new WorkflowProcess();
ArrayList<WFArgument> wfArguments = new ArrayList<WFArgument>();
wfProcess.setProcessName(processName);
for (int i = 0; i < argumentsNameArray.length; i++) {
wfArguments.add( new WFArgument(argumentsNameArray[i], argumentsValArray[i]) );
}
wfProcess.setArguments(wfArguments);
return wfProcess;
}