HttpServletRequest cannot be resolved to a type The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

HttpServletRequest cannot be resolved to a type


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

HttpServletRequest cannot be resolved to a type The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

解决办法:

这是因为项目中缺少两个包 Jsp-api与servlet-api 包  在tomcat的安装文件中可以找到,导入到项目中即可:

HttpServletRequest cannot be resolved to a type The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

在项目的中导入tomcat中的这两个包

HttpServletRequest cannot be resolved to a type The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

如果还报错误那可能是项目中没有导入jdk包 导入即可解决

HttpServletRequest cannot be resolved to a type The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path