MyEclipse中,使用Maven新建web項目後,提示The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
阿新 • • 發佈:2018-09-24
web png -a ips cti code 使用 te pro ron 即可。
問題描述:
使用 MyEclipse + Maven 建立了一個 Javaweb工程,在編寫 JSP頁面 時,頂端出現“紅色”的報錯信息:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path。如下圖所示:
解決方法:
在該項目中的 pom.xml 中添加下面代碼來下載servlet-api,如下所示:
<dependencies> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> <scope>provided</scope> </dependency> </dependencies>
然後 項目右鍵 --> Maven --> Update Project
MyEclipse中,使用Maven新建web項目後,提示The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path