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。原來Javaweb工程類中沒有添加Tomcat運行時相關類導致。
下面是具體的解決方法:
1、右擊web工程-》屬性或Build Path-》Java Build Path->Libraries-> Add Libray...->Server Runtime -》Tomcat Server
2、切換到Java Build Path界面中的Orader and Export,選擇Tomcat。
注意:
按以上方法操作時,若打開Server Runtime后一片空白,需要設置Apache服務器。設置方法為:window->Preferences->Server->Runtime Environment -> add --> 選擇Apache的版本后點Next,再填入你apache服務器軟件的安裝(解壓后)地址。