Browser address bar Url direct transfer array, worded as follows:
localhost/addTopic?topicArr=testTcC&topicArr=testTcD
or
localhost/addTopic?topicArr=testTcC,testTcD
receiving an array controller, as follows:
@RequestMapping("/addTopic")
public String addTopic(String[] topicArr){
System.out.println("打印接收到的数组: "+ Arrays.toString(topicArr));
return "OK";
}
Error writing:
localhost:81/addTopic?topicArr={"testTcC","testTcD"}
localhost:81/addTopic?topicArr[]=testTcC&topicArr[]=testTcD