The type javax.servlet.http.HttpServletRequest cannot be resolved. 解决办法

转载 2018年04月16日 11:06:03
报错信息:
The type javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly referenced from 
 required .class files

原因是缺少serverlet的引用库,解决办法:

1.右键工程 -properties->java build path->在java build path 的 libraries tab页中选择 Add external Jars... 按钮

2.找到eclipse的安装目录,我的是在 E:\eclipse4.7\eclipse\plugins,然后搜索 javax.servlet,找到

javax.servlet.jsp_2.2.0.v201112011158.jar

javax.servlet_3.1.0.v201410161800.jar

进行添加即可。

注:每个版本儿的eclipse这两个文件的后缀不一样,我的是 Oxygen.2 Release (4.7.2)

参考自:https://blog.csdn.net/smartzhaomin/article/details/19487907


The type javax.servlet.http.HttpServletRequest cannot be resolved.

The type javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly referenced from ...
  • smartzhaomin
  • smartzhaomin
  • 2014-02-19 15:00:42
  • 44481

java异常-The type javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly reference

异常内容:The type javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly referenced ...
  • icoudsoft_saas
  • icoudsoft_saas
  • 2016-01-18 00:28:23
  • 1457

The type javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly reference 问题之解决

问题原因: 项目中缺少jar包:servlet-api.jar 解决办法: 方法1:把 servlet-api.jar 添加到项目中(该jar包在Tomcat目录的lib文件夹下) 方法2:项目中添加...
  • yuxuan_08
  • yuxuan_08
  • 2016-08-10 16:40:55
  • 4471

eclipse报错:The type javax.servlet.http.HttpServletRequest cannot be resolved

出现这个问题后,在eclipse中点击左边的红色叉叉,build path,添加外部jar到项目中,这个外部jar就是servlet-api.jar文件,可以在tomcat的lib目录中找到。...
  • u010787773
  • u010787773
  • 2013-12-02 23:34:54
  • 1539

The type javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly referenced fro

今天将一个web项目导入Eclipse的时候,项目报错如下:   The type javax.servlet.http.HttpServletRequest cannot be resolved....
  • zl544434558
  • zl544434558
  • 2014-02-24 18:17:07
  • 2214

The type javax.http.HttpServletRequest cannot be resolved.It is indirectly……问题之解决

原因:项目中缺少servlet-api.jar文件。 解决办法:将D:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib下...
  • piaoxuan1987
  • piaoxuan1987
  • 2014-09-16 12:28:56
  • 12536

Eclipse调错——Type The type javax.servlet.http.HttpServletRequest cannot be res...

一日,从SVN导入一个项目。导入后,Eclipse控制台报错, building this project Androidpn-tomcat Unknown Java Problem Descrip...
  • hlbt0112
  • hlbt0112
  • 2016-03-13 12:28:40
  • 1572

Eclipse中报错The type javax.servlet.http.HttpServletResponse cannot be resolved

工程名右键àbuild pathàconfigurebuild pathàLibrariesàAdd external jarsà在tomcat路径下的lib里有servelet-api.jar包选中...
  • u013931282
  • u013931282
  • 2014-10-10 20:20:42
  • 2020

The import javax.servlet.http.HttpServletRequest cannot be resolved 在Myeclipse buildpath 加server li

项目导入时报错:The import javax.servlet.http.HttpServletRequest cannot be resolved 博客分类: Java javae...
  • waj89757
  • waj89757
  • 2013-03-20 23:00:22
  • 2152

Eclipse 导入web项目后 报 The type javax.servlet.http.HttpServletRequest cannot be resolved.

导入公司项目后各种报错,本来以为为这个菜鸟又要各处问了,结果百度了一下,发现网上说的都是 classpath确实jar包的原因,后来自己分析了一下这几个缺的jar包都是tomcat实现的,可能是自己导...
  • sanfenzhongao
  • sanfenzhongao
  • 2015-07-29 16:16:51
  • 971
收藏助手
不良信息举报
您举报文章:The type javax.servlet.http.HttpServletRequest cannot be resolved. 解决办法
举报原因:
原因补充:

(最多只允许输入30个字)