1.在开发过程中遇到了需要接收数组参数的问题,在网上找了许多方法还是报错非法字符的问题,恳请各位大佬解惑。
2.由于自己用是STS,内嵌tomcat9,已经尝试过了配置tomcat文件的方式
3.相关代码
(1)控制台错误报错 java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:479) ~[tomcat-embed-core-8.5.34.jar:8.5.34] (2)postman输入的urlhttp://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;i++) { System.out.println(arrs[i].toString()); } return true; }
4.恳请大佬们解惑
鸿蒙传说
相关分类