The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

1.选中有问题的文件,右击,选择Build Path -> configure Build Path,进入如下页面:

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

2.选择Add Library,进入如下页面:

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

3.选择Server Runtime,进入如下页面:

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 

4.选择相应的tomcat,点击Finish即可.