1. In the development process encountered the need to receive array parameters, found a lot of methods on the Internet or reported the problem of illegal characters, I urge you to solve the problem.
2. Since I am using STS and embedded tomcat9, I have tried to configure the tomcat file
3. Related codes
(1)
java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:479) ~[tomcat-embed-core-8.5.34.jar:8.5.34]
(2)postmanurl
http://192.168.0.182:8088/Artilce/batchDelete?arrs[0]=1&arrs[1]=2
(3)controller
@RequestMapping(value="/batchDelete",method=RequestMethod.POST)
public boolean batchDelete(@RequestParam(value="arrs[]")Integer [] arrs) {
for(int i=0;i<arrs.length;iPP) {
System.out.println(arrs[i].toString());
}
return true;
}
4. Ask the bosses to answer their doubts