java web中报错HttpServlet cannot be resolved to a type;
在一个java web工程中创建一个servlet类时,会出现HttpServlet cannot be resolved to a type的错误
通过在网上的查询,发现是缺少servlet-api.jar架包
在我的电脑里搜索找到servlet-api.jar,其cope在对应项目WebContext/WEB-INF目录下的lib 文件夹下
(servlet-api.jar在tomcat中可以找到)
以上内容仅供参考