后台错误日志:引号内为参数名称
org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'xxxx' is not present
org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'xxxx' is not present
后台因为不返回视图或跳转视图,所以使用了@ResponseBody注解进行数据返回。
前台ajax书写方式:
//监听提交(方式一)
form.on('submit(submit)', function(data) {
var field = data.field;
$.ajax({
type:'POST',
contentType : 'application/json',
dataType : 'json',
url: '#(ctx)/demo',
data: JSON.stringify(field),
beforeSend: function(xhr){
layer.load();
},
success: function(ret) {
if(ret.success){
$top.successTip("修改成功!");
$p.layer.close(index);
location.reload();
}else {
$top.e