1.解决方案一
pom.xml中添加:
dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
2.解决方案二
1、右击web工程-》属性或Build Path-》Java Build Path->Libraries-> Add Libray...->Server Runtime -》Tomcat Server
2、切换到Java Build Path界面中的Orader and Export,选择Tomcat。 --------------------- 本文来自 jason_3597 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/weixin_40423597/article/details/80558958?utm_source=copy