標籤:項目 class sele bsp web項目 lips eclips 就是 markers
在maven web項目中的index.jsp中的錯誤資訊如下:
The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
從錯誤資訊可以看出來,找不到該類,也就是說找不到相應jar包。
所以解決方案就是引用相應jar包即可。
前提:
需要設定Server Runtime,
Window -> Perferences -> Server -> Runtime Environments -> Add -> Apache Tomcat ... , 這樣一步步做下去即可。
此問題解決方案:
工程右鍵 -> Build Path -> Configure Build Path -> Libraries -> Add Library -> Server Runtime -> 選擇通過上面上面步驟添加的server即可, 最後點擊Apply。
就可以看到jsp頁面上的錯誤消失。
但是你還會發現,工程上有一個小紅叉,解決如下:
首先查看Markers資訊 (Window–>show veiw–>Markers)
錯誤資訊是:
Project configuration is not up-to-date with pom.xml. Select: Maven->Update Project... from the project context menu or use Quick Fix.
按提示步驟做即可解決問題!(工程右鍵 -> Maven -> Update Project)
Eclipse中建立Maven Web項目報錯:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path