使用eclipse JavaEE 版,建立 Dynamic Web Project 項目。在項目裡添加 JSP 檔案,會在檔案頭部出現錯誤提示。提示語句為:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path。如下圖所示:

1. 選中項目右鍵打開快捷菜單。
2. 在快捷菜單中點選 Properties 打開對話框。
3. 在左邊欄選擇 Project Facets,相應的最右邊欄選擇 Runtimes 頁籤,選中對應的apache tomcat 并點選OK,
即可解決該問題。如下圖所示: