How to pass multiple json values in controller of java project

problem description

I want to pass the json value forward, but I"m not sure how to pass multiple
, for example, {aRV 1, precinct, 2, 2, 3, 3, 3, 1, 2, 3,
there are multiple data in a group of json, and then there are multiple sets of data in a group of

, and then there are more than one group of data in a group of JSON

, and then there are multiple sets of data in one group

, and then there are more than one group of data in one group.

the environmental background of the problems and what methods you have tried

related codes

/ / Please paste the code text below (do not replace the code with pictures)

@Controller
@RequestMapping("/some")
public class SomeTestController {

@RequestMapping(value ="/test" )
@ResponseBody
public String getAirportList(HttpServletRequest request) {
    JSONObject json = new JSONObject();
    json.put("a", "1");
    
    
    return json.toJSONString();
}
}

this is the code for controller. It is not clear how to change a single value into multiple values

what result do you expect? What is the error message actually seen?

Jul.26,2021


class A{
  private String a;
  private String b;
}

@RequestMapping(value ="/test" )
@ResponseBody
public String getAirportList(HttpServletRequest request) {
    ArrayList<A> array = new ArrayList<>();
    array.add(new A());
    array.add(new A());
    return arr;
}
Menu