Maven The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

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

猜你喜欢

转载自blog.csdn.net/qq_32067151/article/details/82865351
今日推荐