JSP报错: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。

原来Javaweb工程类中没有添加Web 容器Runtime相关类导致。

错误提示:


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

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

 

参考原文:http://www.cnblogs.com/pszw/p/3677530.html

posted @ 2016-06-17 16:16  GeekSwallow  阅读(173)  评论(0编辑  收藏  举报