小编abh*_*sia的帖子

没有为类org.json.JSONObject找到序列化程序,也没有发现创建BeanSerializer的属性

从Web服务获得JSON,Json Array作为响应

   [3]
   0:  {
   id: 2
  name: "a561137"
    password: "test"
  firstName: "abhishek"
   lastName: "ringsia"
    organization: "bbb"
      }-
    1:  {
      id: 3
  name: "a561023"
password: "hello"
     firstName: "hello"
   lastName: "hello"
     organization: "hello"
   }-
 2:  {
  id: 4
  name: "a541234"
  password: "hello"
 firstName: "hello"
  lastName: "hello"
  organization: "hello"
    }
Run Code Online (Sandbox Code Playgroud)

在JsonArray中获取响应之后在读取Json数组的Json对象时获取错误:

List<User> list = new ArrayList<User>();
JSONArray jsonArr = new JSONArray(response);

for (int i = 0; i < jsonArr.length(); i++) {
    JSONObject jsonObj = jsonArr.getJSONObject(i);
    ObjectMapper mapper = new ObjectMapper();
    User usr= …
Run Code Online (Sandbox Code Playgroud)

java rest serialization spring json

9
推荐指数
1
解决办法
4万
查看次数

标签 统计

java ×1

json ×1

rest ×1

serialization ×1

spring ×1