How to solve “The import javax.servlet cannot be resolved” error
You may encounter “The import javax.servlet cannot be resolved” error when you create dynamic java project as below. Let me explain how to solve this error in this article.
The cause of this error is that build path setting for Apache Tomcat is not set or wrong.
Right click your project, and select Build Path > Configure Build Path…
Select Libraries tab and Click Add External JARs…
Open servlet-api.jar in the folder of apache-tomcat.
Then, click Apply and Close.
OK. “The import javax.servlet cannot be resolved” error is disappeared.
コメント