在配置了官方提供的过滤器后,刚开始启动项目失败,后把过滤器注掉,启动成功。
然后我又把过滤器加上,项目竟能启动了!!!
不过启动项目后Tomcat日志输出java.lang.ClassNotFoundException: org.springframework.web.filter.CharacterEncodingFilter这个问题,当然过滤器没有起作用。真让人头大,后发现是webmvc版本的问题。
之前我的是
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.1.9.RELEASE</version>
</dependency>
后改成
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.3.5</version>
</dependency>
问题就没有了,搞了好多天竟然是这个原因,真的无语。