Tag Archives: JSP error

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

Today, a Javaweb project was established using Eclipse+Maven, and the web container Jboss eap 6.2 was configured in eclipse. Create a new jsp page, add a simple

Java classes. However, a “red” error message appears at the top of the JSP page: The superclass “javax.servlet.http.HttpServlet” was not

found on the Java Build Path. It turns out that there is no Web container Runtime related class added to the Javaweb project class.

Error message:

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

 

The solution is very simple, just add the following configuration in pom.xml:

1  < dependency > 
2  < groupId > javax.servlet </ groupId > 
3  < artifactId > servlet-api </ artifactId > 
4  < version > 2.5 </ version > 
5  < scope > provided </ scope > 
6  </ dependency >

 

Supplement: If you still get an error, you can also try the following ways:

1. Right-click on the web project-“Properties or Build Path-“Java Build Path->Libraries-> Add Libray…->Server Runtime -“JBoss 7.1 Runtime

2. Switch to Orader and Export in the Java Build Path interface, select