Springboot内置Tomcat版本导致的“The valid characters are defined in RFC 7230 and RFC 3986”错误

不用tomcat,改用jetty可以解决

  • 在pom文件中排除tomcat的starter
<dependency>
   <groupId>org.springframework.bootgroupId>
   <artifactId>spring-boot-starter-webartifactId>
   <exclusions>
      <exclusion>
         <groupId>org.springframework.bootgroupId>
         <artifactId>spring-boot-starter-tomcatartifactId>
      exclusion>
   exclusions>
dependency>
  • 增加Jetty依赖
<dependency>
   <groupId>org.springframework.bootgroupId>
   <artifactId>spring-boot-starter-jettyartifactId>
dependency>

你可能感兴趣的:(Spring,Boot)