1. 程式人生 > >Springboot內建Tomcat版本導致的“The valid characters are defined in RFC 7230 and RFC 3986”錯誤

Springboot內建Tomcat版本導致的“The valid characters are defined in RFC 7230 and RFC 3986”錯誤

           不用tomcat,改用jetty可以解決

  • 在pom檔案中排除tomcat的starter
<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-web</artifactId>
   <exclusions>
      <exclusion>
         <groupId>org.springframework.boot</groupId
>
<artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> </dependency>
  • 增加Jetty依賴
<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-jetty</artifactId>
</dependency
>