从数据库中取出ArrayList转JSON的等号=冒号:问题

使用alibaba的fastjson:

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;


@Autowired
private userService userService;
@RequestMapping("findall")
@ResponseBody
public String findall() {
    //从数据库中取出ArrayList数据
    ArrayList<infor> all = userService.findAll();
    JSONArray objects = JSON.parseArray(JSONObject.toJSONString(all));
    //或者  JSONArray objects = JSON.parseArray(JSONObject.toJSONString(all));
    return objects.toJSONString();
    //或者  return objects.toString();
}
原文地址:https://www.cnblogs.com/henuyuxiang/p/14706140.html