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

时间:2021-09-08
本文章向大家介绍The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path,主要包括The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

初始化部署web项目常见错误

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

新建的web项目,项目所有jsp页面报错如下

1)在出现此错误的项目上右键-->Build Path --> Configure Build Path

2)点击右边的 ADD Library->server Runtime

3)选择部署好的tomcat,即可错误消失。

4)如错误继续存在,右键项目点击Refresh

5)如继续出现错误,找到tomcat的安装目录的lib下,

或者在项目的环境下是否有servlet-api.jar包,如没有可手动添加后再重新配置。

(之前试过百度下载的tomcat没有servlet-api.jar)

 2、There are no resources that can be added or removed from the server

项目添加不进对应的servers

项目上右键-->Build Path --> Configure Build Path

进入Project Facets 选中Dynamic Web Module和java

原文地址:https://www.cnblogs.com/in177/p/15243264.html