接口中带有中文,tomcat8
17-Apr-2019 13:21:23.734 严重 [http-nio-8082-exec-2] org.apache.coyote.http11.AbstractHttp11Processor.process Error processing request java.lang.IllegalArgumentException: Control character in cookie value or attribute. at org.apache.tomcat.util.http.LegacyCookieProcessor.isV0Separator(LegacyCookieProcessor.java:729) at org.apache.tomcat.util.http.LegacyCookieProcessor.processCookieHeader(LegacyCookieProcessor.java:526) at org.apache.tomcat.util.http.LegacyCookieProcessor.parseCookieHeader(LegacyCookieProcessor.java:256) at org.apache.catalina.connector.Request.parseCookies(Request.java:3059) at org.apache.catalina.connector.Request.getServerCookies(Request.java:2075) at org.apache.catalina.connector.CoyoteAdapter.parseSessionCookiesId(CoyoteAdapter.java:1211) at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:918) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:497) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1533) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1489) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)
解决方法:
在tomcat下的conf/context.xml
<Context> <CookieProcessor className="org.apache.tomcat.util.http.Rfc6265CookieProcessor" /> </Context>