The import javax.servlet cannot be resolved
在使用Eclipse时会出现 The import javax.servlet cannot be resolved 错误,出现的原因是因为缺少 servlet-api.jar 包。
解决方法:
1.右键项目,选择 Build Path->configure build path->Libraries->Add External JARs
2.找到你计算机中tomcat的解压路径,在lib文件夹下选中”servlet-api.jar”,添加点击“确定”
3.点击ok后发现问题解决了!