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

在Eclipse中新建java web项目,在JSP页面的第一行提示这个错误。

原因是缺少tomcat运行时相关的类。

解决办法如下:

一、设置web server运行环境参数。

① 点击Window -> Preferences -> Server -> Runtime Environments 弹出Server Runtime Envirnoments窗口。

② 选择Server Runtime Envirnoments窗口的Add按钮。根据机器中的实际Tomcat版本配置相关信息。

  例如:我的机器中安装了apache-tomcat-6.0.35,

第一步选择对应的Apache Tomcat v6.0。

下一步,在Tomcat installation directory中选择安装包的具体路径。

最后,点击Finish完成web server环境参数配置。

二、在项目中导入Server Runtime库。

① 右键web工程 -> Build Path -> Add Libraries... -> Server Runtime -> Next -> 选择配置好的Server。

例如上文例子中的Apache Tomcat v6.0。

完成导入。

正常情况下,标题的报错信息也就消失了。

时间: 2024-11-10 01:29:40

The superclass "javax.servlet.http.HttpServlet" was not found on the Java的相关文章

JavaWeb: 报错信息The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

JavaWeb: 报错信息The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 好久不写Jsp,今天建立了一个Javaweb工程,并在eclipse中配置了Web容器Tomcat.原本开心的新建jsp页面,添加一个简单的Java类.可是,JSP页面顶端出现“红色”的报错信息:The superclass "javax.servlet.http.HttpServl

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

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 用eclipse做jsp文件,自动创立的文件表头出现这个报错,应该怎么处理?tomcat的插件已经安装上了. 有一处刚发现了,是中英文标点问题,这两处,一个是The word 'username' is not correctly spelled,还一个是The document body. Contains all

eclipse:报错信息The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

JavaWeb: 报错信息The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 今天建立了一个Javaweb工程,并在eclipse中配置了Web容器Tomcat.JSP页面顶端出现“红色”的报错信息:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Bu

eclipse中web工程新建jsp文件报错: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 解决方案: 1.右击web工程->属性或Build Path->Java Build Path->Libraries-> Add Libray...->Server Runtime ->JBoss 7.1 Runtime   2.切换到Java Bui

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

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

在静态项目上新建 jsp文件的时候,报错:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 这时需要在eclipse中的 windows->references->Server->Runtime Environments中添加服务器即可.

新建 jsp异常,The superclass &quot;javax.servlet.http.HttpServlet&quot; was not found on the Java Build Path

新项目,新建jsp页面的时候报异常: Multiple annotations found at this line: - The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path - The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 右

JavaWeb:报错信息The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 解决办法

JavaWeb: 报错信息The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 好久不写Jsp,今天建立了一个Javaweb工程,并在eclipse中配置了Web容器Tomcat.原本开心的新建jsp页面,添加一个简单的Java类.可是,JSP页面顶端出现"红色"的报错信息:The superclass "javax.servlet.http

eclipse中,项目有红叉之- The superclass &quot;javax.servlet.http.HttpServlet&quot; was not found on the Java Build Path

1.The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 2.原因:确实servlet-api.jar 3.导入servlet-api.jar,其中一种方法:项目右击->build path->configure build path->add library->server runtime->apache tomcat

ubuntu下eclipse遇到The superclass &quot;javax.servlet.http.HttpServlet&quot; was not found on the Java Build Path

JSP页面顶端出现“红色”的报错信息:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path.原来Javaweb工程类中没有添加Tomcat运行时相关类导致.下面是具体的解决方法:1.右击web工程->属性或Build Path->Java Build Path->Libraries-> Add Libray...->Server Runtim