Httpservlet cannot be resolved to a type,显然是Eclipse找不到相应的包,即javax.servlet。

分析原因:JDK里不包括servlet-api.jar 这个包,此包在Tomcat 中存在 ,如下图所示:

Httpservlet cannot be resolved to a type的原因与解决方法~

在自己电脑上找到servlet-api.jar并将其copy到相应项目的WebContext/WEB-INF目录下的lib 文件夹下即可完美解决~

Httpservlet cannot be resolved to a type的原因与解决方法~

相关文章:

  • 2021-06-23
  • 2021-07-27
  • 2021-10-18
  • 2021-06-17
  • 2022-12-23
  • 2022-01-14
  • 2021-09-01
猜你喜欢
  • 2021-10-14
  • 2021-09-09
  • 2022-01-15
  • 2021-10-28
相关资源
相似解决方案