在Eclipse中,project->properties,选择Java Build Path->Libraries->Add External JARs,找到你计算机中tomcat的安装路径,在common\lib文件夹下选中"servlet-api.jar",添加点击“确定”