org.springframework.web.servlet.DispatcherServlet’ is not assignable to javax.servlet.Servlet
①pom.xml配置
<dependency> <groupId>jakarta.servlet</groupId> <artifactId>jakarta.servlet-api</artifactId> <version>6.0.0</version> <scope>provided</scope> </dependency>
②web.xml报错
因为tomcat9配置的是javax.servlet-api,升级到tomcat10后,依赖需要改成jakarta.servlet-api,然后spring相关版本也需要升级到6.x.x才行。
标签:tomcat,jakarta,tomcat10,idea,api,servlet,javax From: https://www.cnblogs.com/yllovexjj/p/17007490.html