var studentEntity= {};
studentEntity["name"] = $("#name").val()
studentEntity["stuNo"] = $("#stuNo").val();
$.ajax({
type: "get",
url:"${base}/studentController.do?save" ,
async:false,
dataType: "json",
data:studentEntity,
success:function(data) {
if(data.result ){
if( data.data > 0){
alert(data.data);//data.data= comparativePriceVo
});
}
error:function(){alert("出错"))}
});
@RequestMapping("/save")
@ResponseBody
public ResponseEntity<JsonResult> saveStudentEntity( StudentEntity studentEntity) {
if( studentEntity!=null ) {
return ControllerHelper.returnJSONResult(true, "保存成功,页面将跳转", studentEntity);
}else {
return ControllerHelper.returnJSONResult(false, "新建失败!");
}
}
studentEntity["name"] = $("#name").val()
studentEntity["stuNo"] = $("#stuNo").val();
$.ajax({
type: "get",
url:"${base}/studentController.do?save" ,
async:false,
dataType: "json",
data:studentEntity,
success:function(data) {
if(data.result ){
if( data.data > 0){
alert(data.data);//data.data= comparativePriceVo
});
}
error:function(){alert("出错"))}
});
@RequestMapping("/save")
@ResponseBody
public ResponseEntity<JsonResult> saveStudentEntity( StudentEntity studentEntity) {
if( studentEntity!=null ) {
return ControllerHelper.returnJSONResult(true, "保存成功,页面将跳转", studentEntity);
}else {
return ControllerHelper.returnJSONResult(false, "新建失败!");
}
}