Maven工程下报错:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
Maven工程下,webapp下面新建index.jsp文件,报如下错误。
原因很简单,没有安装如下maven依赖包:
<dependencies> <!-- JSP相关 --> <dependency> <groupId>jstl</groupId> <artifactId>jstl</artifactId> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jsp-api</artifactId> <scope>provided</scope> </dependency> </dependencies>