java.lang.IllegalArgumentException: Invalid character found in the request target. The valid charact

java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986


org.apache.coyote.http11.AbstractHttp11Processor process

信息: Error parsing HTTP request header

 Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.

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.AbstractNioInputBuffer.parseRequestLine(AbstractNioInputBuffer.java:283)

at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1017)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1524)

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1480)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:745)

环境描述

spring MVC 使用 @RequestBody 接收JSON参数转为实体对象

public void save(@RequestBody Scene scene, HttpServletRequest  
        request, HttpServletResponse response) throws Exception {  
  
}  
当在浏览器中访问时 URL中带有特殊字符,如花括号冒号时,就会出现这个错误。

例如:http://localhost:8080/index.do?{id:123}

你可能感兴趣的:(java,spring,mvc,character,RequestBody)