How in the browser address bar, wrote directly to the array parameter passed in the url?

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

 

Published 23 original articles · won praise 6 · views 10000 +

Guess you like

Origin blog.csdn.net/weixin_42046751/article/details/104215471