ajax:post 400错误

 POST http://localhost:8080/purchase/purchase-apply/update.htm 400 (Bad Request)

n.ajaxTransport.k.cors.a.crossDomain.send

n.extend.ajax

(anonymous function)

n.event.dispatch

n.event.add.r.handle

 

ajax异步提交,springmvc框架

在controller中加入:

@RequestMapping(value = ADD, method = RequestMethod.POST)

@ResponseBody public Result add(@RequestBody YearContract yearContract)

{



purchaseLongTermContractAo.add(yearContract);

return SUCCESS;

}

在方法体上加入:

@ResponseBody即可解决

 

你可能感兴趣的:(Ajax)