@RequestMapping(method=RequestMethod.GET)
@ResponseBody
public TaoResult queryListByPage(@RequestParam(value="page",defaultValue="1") Integer page,@RequestParam(value="rows") Integer pageSize){
TaoResult list=itemService.queryListByPage(page,pageSize);
return list;
}
我是这么写的,list中是有数据的,为什么回显报空指针
HTTP Status 500 - Could not write content: (was java.lang.NullPointerException) (through reference chain: com.taotao.common.result.TaoResult["rows"]->java.util.ArrayList[0]->com.taotao.manager.pojo.Item["itemCat"]->com.taotao.manager.pojo.ItemCat["state"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.NullPointerException) (through reference chain: com.taotao.common.result.TaoResult["rows"]->java.util.ArrayList[0]->com.taotao.manager.pojo.Item["itemCat"]->com.taotao.manager.pojo.ItemCat["state"])这是报的错,就是数据转json对象报空指针了,因为我的前端是用的Easyui,所以需要json对象数据
springmvc和mybatis多对一的查询在controller返回数据时报空指针?
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-