求个大神帮我看一下呗,为什么怎么改都是没反应呢?
后台控制台也打印不出来,一个Action里的其他请求也都有反应啊?
为什么呢 我很纠结 快崩溃了
Client code:
// modify
$("#submition").on("click",function(){
alert($("input[class='form-control']:eq(2)").val() );
console.log();
$.ajax({
url : "../updateCollection",
type : "post",
datatype : "json",
async : "false",
data : {
"collection.id" : getValue("id"),
"collection.author" : $("input[class='form-control']:eq(2)").val(),
"collection.barcode" : $("input[class='form-control']:eq(2)").val(),
"collection.category" : $("input[class='form-control']:eq(3)").val(),
"collection.description": $("#description").text(),
"collection.link" : $("input[class='form-control']:eq(4)").val(),
"collection.total" : $("input[class='form-control']:eq(5)"),
"collection.status" : $("status").val()
},
success:function(data){
alert("success");
$.each(data.data, function(k, v) {
if (v == "updateTrue") {
layer.msg('添加成功');
} else {
layer.msg('添加失败');
}
})
}
})
})
Server code:
@Action(value = "updateCollection", results = { @Result(name = "success", type = "json"),
@Result(name = "error", type = "json") })
public String modifyCollection() {
System.out.println("======================================================================");
System.out.println(collection.getAuthor());
System.out.println(collection.getAuthor());
System.out.println(collection.getAuthor());
data = new ArrayList();
if(service.modifyOne(collection)) {
data.add("updateTrue");
}else {
data.add("updateFalse");
}
return SUCCESS;
}