問題描述:
HttpServletRequest cannot be resolved to a type。
Multiple markers at this line
- The import javax.servlet.http cannot be resolved
- The import javax.servlet.http cannot be resolved
- The import javax.servlet.http cannot be resolved
解決方案:
1.這個錯誤可能是服務器自帶的servlet庫未導入的原因。
2.右鍵項目屬性,轉到Targeted Runtimes,選擇一個服務器,例如Tomcat,單擊應用,可能就可以解決。
3.或者一開始建立項目就如下Targeted Runtimes