小编是新手,在新建立的Maven Web工程后,JSP文件会报The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path的错误。网络上也找了很多方法,终于解决了,原因是该工程的Java构建路径并没有关联Tomcat容器的jar包。

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

解决方案:

1.选中工程,右键单击→Properties,会出现配置界面,选择Java Build Path,点击Libraries,点击Add Library...

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

2.选择Server Runtime,点击Next

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

3.出现你所配置的Tomcat,选中需要的版本,点击Finish

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

4.工程就会关联Tomcat的jar包,点击Apply and Close

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

6.报错就会消失,又可以愉快的进行JSP的编写啦~

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

相关文章:

  • 2021-10-04
  • 2021-04-17
猜你喜欢
  • 2022-01-19
  • 2021-10-06
  • 2021-04-15
  • 2021-06-25
  • 2022-12-23
  • 2021-04-05
  • 2021-08-02
相关资源
相似解决方案