jsp报错:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

                                                                                                                                                        ——你 


在用Eclipse进行开发时,可能会出现这样的错误:The superclass javax.servlet.http.HttpServlet was not found on the Java Build Path。我们该怎么解决这个问题呢?

我遇到的错误显示如下:



我创建的是maven项目,有两种解决办法:

1、跟图配置项目即可:








2、第二种方式:

解决方法很简单,在pom.xml中添加如下配置即可:

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>


猜你喜欢

转载自blog.csdn.net/qq_21870555/article/details/80622505