url参数中带中⽂,请求时400,已解决!
url 参数中带中⽂,请求时400,已解决!
报错信息
java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230and RFC 3986 http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:469)
http11.Http11Processor.service(Http11Processor.java:260)
AbstractProcessorLight.process(AbstractProcessorLight.java:65)
AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
at.util.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1639)
at.util.SocketProcessorBase.run(SocketProcessorBase.java:49)
urrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
urrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:748)
解决办法:
把注释掉的添加上,也就是对有可能会出现中⽂的进⾏编码解决
成功
url编码和utf8区别
2020-5-19 ⼜碰到乱码问题
js 代码:
var code =encodeURI('${tenProCode}');
后台接收code,乱码,经过百度,解决!!java 代码:
URLDecoder.decode(code,"utf8")
打印输出:

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。