@RequestMapping(value = "getProduce/{id}",method = RequestMethod.GET)
@ResponseBody
public Produce getProduce(@PathVariable Integer id)throws JsonProcessingException {
Produce produceDetails = produceDao.getProduceDetails(id);
return produceDetails;
}
$table.on("click", "a.edit", function () {
alert("asdasd");
$.get("security/maintenance/getProduce/"+$(this).attr("id"),function (data) {
var data = JSON.parse(data);
$("#title").val(data.title);
$("#create_time").val(data.create_time);
$("#picture").val(data.picture);
$("#content").val(data.content);
},'text'),
$("#flagDiv").show();
$.uniform.update();
$("#modalTitle").html(i18n['editUser']);
customGlobal.clearFormAndShowDialog("modalDialog");
$("#dialogForm").validate({
rules: {
username: {
required: true
},
nickname: {
required: true
},
}
})
$("#addBtn").hide();
$("#updateBtn").show();
dataTable.reloadTable();
});
有没有忘记加@controller 你的参数应该这么写@PathVariable("id") Integer id