Eclipse中新建Maven Web项目报错:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

在maven web项目中的index.jsp中的错误信息如下:

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

从错误信息可以看出来,找不到该类,也就是说找不到相应jar包。

所以解决方法就是引用相应jar包即可。

前提:

需要设置Server Runtime,

Window -> Perferences -> Server -> Runtime Environments -> Add -> Apache Tomcat ... , 这样一步步做下去即可。

此问题解决方法:

工程右键 -> Build Path -> Configure Build Path -> Libraries -> Add Library -> Server Runtime -> 选择通过上面上面步骤添加的server即可, 最后点击Apply。

就可以看到jsp页面上的错误消失。

但是你还会发现,工程上有一个小红叉,解决如下:

首先查看Markers信息 (Window–>show veiw–>Markers)

错误信息是:

Project configuration is not up-to-date with pom.xml. Select: Maven->Update Project... from the project context menu or use Quick Fix.

按提示步骤做即可解决问题!(工程右键 -> Maven -> Update Project)

时间: 2024-12-28 04:20:30

Eclipse中新建Maven Web项目报错:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path的相关文章

Java Web 项目报错The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

原因是你的项目配置的库有问题,没有吧Tomcat服务器的库配置进去,要重新配置 添加库 选择Server Runtime后点击下一步 选中Tomcat服务器,点击finish 成功导入后就会发现少了的下图第一个库又回来了 原文地址:https://www.cnblogs.com/Coding-and-Teaching/p/12334923.html

eclipse新建maven项目报错The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path的解决方案

具体表现为: 使用Eclipse+Maven建立了一个Javaweb工程,JSP页面顶端出现“红色”的报错信息:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path. 解决方法: 在pom.xml中的  <build></build>中  添加: <plugins> <!-- 编码和编译和JDK版本 --> <plug

index.jsp报错The superclass &quot;javax.servlet.http.HttpServlet&quot; was not found on the Java Build Path的解决办法

1.index.jsp报错The superclass "javax.servlet.http.HttpServlet" was not found on the   Java Build Path的解决办法 主要是Javaweb工程类中没有添加Web 容器Runtime相关类导致: 第一: 右击项目名称->propertise->java build path->libraries->add libraries->server runtime->选

eclipse中web工程新建jsp文件报错:The superclass &quot;javax.servlet.http.HttpServlet&quot; was not found on the Java Build Path

web工程中新建jsp文件提示:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 解决方案: 1.右击web工程->属性或Build Path->Java Build Path->Libraries-> Add Libray...->Server Runtime ->JBoss 7.1 Runtime   2.切换到Java Bui

web项目jsp出现The superclass javax.servlet.http.HttpServlet was not found on the Java Build Path错误

今天搭建环境Eclipse,一个简单的jsp页面出现这样报错:The superclass javax.servlet.http.HttpServlet was not found on the Java Build Path. 原因是Javaweb工程类中没有添加Tomcat运行时相关类导致. 解决方式如下:出错的文件---->>build path---->>config build path---->>java build path---->>libr

新建jsp报错“The superclass &quot;javax.servlet.http.HttpServlet&quot; was not found on the Java Build Path”

今天新建jsp文件时,就报错“Visual Page Editor has experimental support for Windows 64-bit”,然后刚好stackoverflow上面有这个错误的解决方案,传送门:https://stackoverflow.com/questions/30274852/visual-page-editor-has-experimental-support-for-windows-64-bit,据说是JBoss的小问题,然后就按照操作了一遍,但还是报错

java web报错The superclass &quot;javax.servlet.http.HttpServlet&quot; was not found on the Java Build Path

刚用maven建立了一个web项目,结果报错了,解决办法 原文地址:https://www.cnblogs.com/huifeidezhuzai/p/10015531.html

新建maven工程使用webapp插件弹出javax.servlet.http.HttpServlet was not found on the Java Build Path异常

检查pom.xml文件中是否引用javax.servlet,引用如下所示:

Eclipse新建web项目出现The superclass &quot;javax.servlet.http.HttpServlet&quot; was not found on the Java Build Path

Eclipse新建web项目出现The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 新建web项目后都,jsp页面顶端出现"红色"的报错信息:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path,经过仔细查看,原来是