首页 > 编程语言 > 详细

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

时间:2018-09-24 21:01:47      阅读:162      评论:0      收藏:0      [点我收藏+]

问题描述:

  使用 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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!