ResponseBody 返回实体类报错 急在线等
源码:
@RequestMapping("/list.do")
@ResponseBody
public ResponseResult<List<Address>> getList(
HttpSession session) {
// 获取uid
Integer uid = getUidFromSession(session);
Address add = new Address();
add.setId(1);
// 调用业务层方法获取列表
List<Address> addresses = new ArrayList<Address>();
addresses.add(add);
// 创建返回值对象
ResponseResult<List<Address>> rr
= new ResponseResult<List<Address>>();
// 将列表封装到返回值对象中
rr.setData(addresses);
// 执行返回
return rr;
}
返回报错:
Request processing failed; nested exception is java.lang.IllegalArgumentException: No converter found for return value of type: cn.demo.ResponseResult