SpringMVC - AJAX

@RequestMapping(value = "updateAttrByAjax.do",method = RequestMethod.GET)
@ResponseBody
public String updateAttrByAjax(@ModelAttribute("bean") Info bean,Integer[] attrIds,HttpServletRequest request){
//do something

return AjaxCode.SUCCESS;//实际上是一个 String
}



$.ajax({
		type: "GET",
		url: "updateAttrByAjax.do",
		data: "oid=" + id + attr,
		success: function(data){
			if (data == "success") {}
	});

你可能感兴趣的:(springMVC)