Eclipse正常启动,IDEA却报错java.lang.ClassNotFoundException: javax.servlet.Filter
Eclipse和IDEA内置tomcat机制不同,解决办法:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
<scope>compile</scope> <!-- 这行删除或者provided换成compile(scope的默认值) -->
OK!问题解决!不会的给我私信!
觉得有帮助的可以关注一波!经常分享编程踩坑经验!