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

The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path错误

相信大家都遇到过这种情况,在写jsp文件的时候,开头处会显示一个红叉即错误提示,如下图所示:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
虽然说这种情况下,jsp文件依然可以正常运行,但是对于强迫症的兄弟,看着一个个红叉,心态会炸裂。放轻松,take it easy,因为解决方法来了!

The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path解决方法

  1. 先在项目资源管理器那里,右键选中你的Dynamic Web Project
    项目文件夹,会弹出如图:
    The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
  2. 点击配置构建路径,弹出以下画面,再按图示操作:
    The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
    The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
    The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
    The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
  3. 完成以上步骤后就可以发现红叉消失掉了,舒服~
    The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path