ssm框架 使用ajax获取list集合,得到对象内容是空
jsp内容
$(function(){
$("#searchCustomer").click(function(){
$.post("${pageContext.request.contextPath}/customer/searchCustomer",$('#search').serialize(), function(data) {
alert(data);
console.log(data);
}, "json");
})
})
controller内容 得到的list集合,对象有内容
//搜索用户
@RequestMapping("searchCustomer")
@ResponseBody
public List<Customer> searchCustomer(Customer customer,Model model,HttpServletRequest request){
List<Customer> lists=new ArrayList<Customer>();
lists=customerService.searchCustomer(customer);
return lists;
}
得到![console的结果数量正确,可是内容是空](https://img-ask.csdn.net/upload/201702/26/1488095897_93541.png)
![network得到的内容就变成空的了](https://img-ask.csdn.net/upload/201702/26/1488096109_519182.png)