JSP页面顶部报错:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

有时在编写JSP页面或者直接拷贝别人的JSP页面时,顶端会出现报错信息:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path。这主要的原因是没有添加JavaWeb工程的Tomcat运行时相关类。

解决方法如下:

1、右键点击项目名->Build Path->Java Build Path->Libraries-> Add Libray...->Server Runtime ->Tomcat Server

2、然后切换到Java Build Path界面中的Orader and Export,选择Tomcat

3、具体的操作示例截图如下

报错信息:

具体操作:

错误提示消失

猜你喜欢

转载自blog.csdn.net/pcwl1206/article/details/82895742