JavaWeb:報錯信息The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

JavaWeb: 報錯信息The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

好久不寫Jsp,今天建立了一個Javaweb工程,並在eclipse中配置了Web容器Tomcat。原本開心的新建jsp頁面,添加一個簡單的Java類。可是,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。
http://blog.csdn.net/fei20072050104/article/details/21785565
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章