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

Reason:

 jdk 里不包括servlet-api.jar 这个包,此包在Tomcat 中存在 

项目名--> 右键 

Property--> 选择 

Java Build Path--> 选择 

Add External JARs--> 选择 

把servlet-api.jar 的路径输入即可

eg:

How to solve for Httpservlet cannot be resolved to a type

相关文章:

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