"Reprint, original Bo: http://www.cnblogs.com/pszw/p/3677530.html"
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 and add a simple Java class. However, a "red" error message appears at the top of the JSP page: the superclass "Javax.servlet.http.HttpServlet" was notfound on the Java Build Path. The original Javaweb project class did not add the Web container runtime related classes caused.
Error message:
The workaround is simple, add the following configuration to the Pom.xml:
<dependency><groupId>javax.servlet</groupId><artifactId>servlet-api</artifactId> <version>2.5</version><scope>provided</scope></dependency>
Add: If you are also prompted for an error, you can also try the following:
1. Right-click 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
The superclass "Javax.servlet.http.HttpServlet" is not found on the Java Build Path