java項目jsp報錯
有時在導入maven項目時,jsp頁面一直報錯,具體解決方法及步驟如下:
1、在pom.xml配置文件中添加上javax.servlet的相關依賴:
<dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> <scope>provided</scope> </dependency>
2、依賴tomcat類庫:
項目右擊—>build path —> configure build path — >libraries — > add libraries —> Server Runtime — >選擇一個服務器lib —> ok
3、若不能解決報錯,請繼續(xù)操作
點擊windows—>Preferences—>Validation—>把Show a confirmation dialog when performng manual validations 前邊的√去掉—>Disable All —> apply —> ok
推薦教程:java教程