天天看點

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後确定即可

繼續閱讀