我在 spring ajax 调用中遇到错误。我知道这是一些语法错误,但找不到是什么。有人可以帮忙吗?
脚本:
$.ajax({
type : 'POST',
contentType : 'application/json; charset=utf-8',
url: 'saveCommittedAmount.html?investmentId='+investmentId+ '&=transactionData' +transactionData + '&=investorId' +investorId + '&committedAmt='+committedAmt,
success: function(response) {
return false;
}
});
弹簧控制器:
@RequestMapping(value = "/saveCommittedAmount", method = RequestMethod.POST)
@ResponseBody
public String saveInvestmentValue(@RequestParam("investmentId") String investmentId,
@RequestParam("transactionDate") String transactionDate,@RequestParam("investorId") String investorId,
@RequestParam("committedAmt") String committedAmt) throws ParseException {
Transaction transaction = new Transaction();
Date tDate = (Date) new SimpleDateFormat("MM/dd/yyyy").parse(transactionDate.trim());
transaction.setCommittedAmount(BigDecimal.valueOf(Double.valueOf(committedAmt)));
transaction.setUserId(Integer.parseInt(investorId));
System.out.println("committedAmt" + "committedAmt");
transaction.setTransActDate(tDate);
transaction.setInvestmentId(Integer.parseInt(investmentId));
assetService.updateTransaction(transaction);
return Constants.RESPONSE_SUCCESS;
}