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

Adding the tomcat server in the server runtime will do the job :

Project Properties-> Java Build Path-> Add Library -> Select "Server Runtime" from the list-> Next->Select "Apache Tomcat"-> Finish

Adding below dependency in pom.xml, worked for me.

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>

I too received the same error as quoted below:

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

I followed these steps to resolve the issue:

  1. Right Click on Project
  2. Select Properties
  3. Select Project Facets
  4. Select Apache Tomcat as Runtime server
  5. Click OK