Jsp页面报错The superclass "javax.servlet.http.HttpServlet" was not found on the Java

Eclipse创建jsp后报错Multiple annotations found at this line:- The superclass “javax.servlet.http.HttpServlet” was not found on the JavaBuild Path- The superclass “javax.servlet.http.HttpServlet” was not found on the JavaBuild Path

这里写图片描述
在这里插入图片描述

是因为缺少servlet-api.jar右击项目文件,选择Build Path–>Configure Build Path…–>Libraries如果没有Apache Tomcat,就点击Add Library–>Server Runtime–>Next–>选择Apache–>Finish,刷新项目看看错误是否消失。

如果有Apache Tomcat就点击Add Library…–>Server Runtime–>Next–>点击Apache tomcat->Finish–>ok,
在这里插入图片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章