新建maven工程报错:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path解决方案

在eclipse下新建maven工程之后会报错:

新建maven工程报错:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path解决方案

解决方案如下:

1.右击报错的文件—【Build Path】—【Configure Build Path】

新建maven工程报错:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path解决方案

2.进入设置界面,【Libraries】—【Add Library】—【Server Runtime】之后,选择你需要的Web服务软件之后,完成即可

新建maven工程报错:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path解决方案