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

MyEclipse中,使用Maven新建web项目后,提示The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

时间:2018-09-24 21:16:10      阅读:143      评论:0      收藏:0      [点我收藏+]

标签:pen   添加   maven   was   web   ima   servlet   The   image   

问题描述:

  使用 MyEclipse + Maven 建立了一个 Javaweb工程,在编写 JSP页面 时,顶端出现“红色”的报错信息:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path。如下图所示:

  技术分享图片

解决方法:

  在该项目中的 pom.xml 中添加下面代码来下载servlet-api,如下所示:

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

  然后 项目右键 --> Maven --> Update Project 即可。

MyEclipse中,使用Maven新建web项目后,提示The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

标签:pen   添加   maven   was   web   ima   servlet   The   image   

原文地址:https://www.cnblogs.com/chenmingjun/p/9696518.html

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