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

Posted 随风残虹

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了The type javax.servlet.http.HttpServletRequest cannot be resolved.的解决方法相关的知识,希望对你有一定的参考价值。

Bug的描述

The type javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly referenced from 
 required .class files

解决方法

是缺少serverlet的引用库,解决如下
1.工程右键-properties->java build path
2.在java build path的libraries tab页中选择Add external Jars...按钮
3. 选择eclipse的安装目录,我的是绿色版本,我本机的路径如下,你自己需要根据自己的路径查找添加。E:\eclipse-java-indigo-SR1-win32\eclipse\plugins 选择javax.servlet.jsp_2.0.0.v201101211617.jar;javax.servlet_2.5.0.v201103041518.jar 进行添加即可
注释:由于版本不同,文件包名可能稍有区别。




以上是关于The type javax.servlet.http.HttpServletRequest cannot be resolved.的解决方法的主要内容,如果未能解决你的问题,请参考以下文章

The method getContextPath() from the type HttpServletRequest refers to the missing type

The method queryForMap(String, Object...) from the type JdbcTemplate refers to the missing type Data

[WPF]The type name ‘App’ does not exist in the type '...'的问题

The method xx from the type xx refers to the missing type List等问题的解决办法

Array types are now written with the brackets around the element type问题的解决方法

返回suggester的类型(Returning the type of the suggester)