码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2017-08-28 00:46:24      阅读:235      评论:0      收藏:0      [点我收藏+]

标签:右击   ges   容器   blog   配置   not found   ora   界面   not   

【转载,原博:http://www.cnblogs.com/pszw/p/3677530.html】

今天使用Eclipse+Maven建立了一个Javaweb工程,并在eclipse中配置了Web容器Jboss eap 6.2。新建jsp页面,添加一个简单的Java类。可是,JSP页面顶端出现“红色”的报错信息:The superclass "javax.servlet.http.HttpServlet" was notfound on the Java Build Path。原来Javaweb工程类中没有添加Web 容器Runtime相关类导致。

错误提示:

技术分享

 

 

解决方法很简单,在pom.xml中添加如下配置即可:

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>

补充:如果还提示错误,还可以尝试下面的方式:

1、右击web工程-》属性或Build Path-》Java Build Path->Libraries-> Add Libray...->Server Runtime -》JBoss 7.1 Runtime

技术分享

2、切换到Java Build Path界面中的Orader and Export,选择

技术分享

 

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

标签:右击   ges   容器   blog   配置   not found   ora   界面   not   

原文地址:http://www.cnblogs.com/eXceedZhou/p/7440708.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!