Programmers learn & share
0 votes
31 views

Problem :

I created a project by Maven integration in Eclipse , but in the work space in all JSP files have bellow message:

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

by (6.9k points)   | 31 views

1 Answer

0 votes

Solution :

1. For an Ant project:

Please make sure you have servlet-api.jar in the lib folder.

2. For a Maven project:

Please make sure you have the dependency added in POM.xml.

<dependency>
  <groupId>javax.servlet</groupId>
  <artifactId>javax.servlet-api</artifactId>
  <version>3.1.0</version>
  <scope>provided</scope>
</dependency>

3. Another way to do it is

Please update the project facets to pick up the right server.

Please check this box in this location:

Project → Properties → Target Runtimes → Apache Tomcat (**any server**)

by (36.1k points)  
2,183 questions
2,490 answers
59 comments
241 users