POST http://localhost:7001/app/workflow/execute/ 400 (Bad Request)
Estou obtendo esse erro ao tentar enviar 2 array's para o meu controller Spring, porém estou obtendo esse erro, tentei algumas soluções que encontrei no SOen porém não obtive sucesso. A versão do meu Spring é a 3.0.2.
Código JS
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);
});
Código java
@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;
}