Eclipse项目jsp页面报错 The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Pat

问题描述

新建一个java项目,在WebContent下新建了一个jsp页面,页面顶部报错 The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

 

解决方案

模块的Build Path缺少Tomcat的Library

项目右键 - Build Path - Configure Build Path - Add Library - Server Runtime - Tomcat

  • 项目右键 - Build Path - Configure Build Path

        

  • 点击Add Library

       

  • 选择Server Runtime

       

  • 选择相应版本的Tomcat

       

  • Finish后确定即可

猜你喜欢

转载自blog.csdn.net/weixin_42089175/article/details/89162016