天天看点

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

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

解决方案

模块的Build Path缺少Tomcat的Library

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

  • 项目右键 - Build Path - Configure Build Path
Eclipse项目jsp页面报错 The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Pat
  • 点击Add Library
Eclipse项目jsp页面报错 The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Pat
  • 选择Server Runtime
Eclipse项目jsp页面报错 The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Pat
  • 选择相应版本的Tomcat
Eclipse项目jsp页面报错 The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Pat
  • Finish后确定即可

继续阅读