Error:

The import javax.servlet cannot be resolved

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

Description:

我们经常会把别人的项目copy到自己这里进行二次开发或者参考,有的时候会发生上面的错误,

?

即eclipse项目里我们导进的项目里提示HttpServletRequest 不能引用,会伴随头疼的小红叉出现。

Accuse:

具体原因是我们工程里面web-inf/lib目录下少了相应的包:Package javax.servlet.http引起的;

通俗且确切的讲就是缺少TOMCAT_HOME\lib下的servlet-api.jar

我导进别人的项目,在别人的机器上他配置了Server,一般都是tomcat,而在拷贝的过程中Server的那些library是不会随项目一起拷贝过来的,除非别人把tomcat的library已经拷贝到WEB-INF\lib下了。

Action:

Project -> Properties -> Java Build Path -> Add Library -> Server Runtime -> next -> 选择你的Server -> Finish

The import javax.servlet.http.HttpServletRequest cannot be resolved的更多相关文章

  1. 在Myeclipse buildpath 加server lib (server runtime)/项目导入时报错:The import javax.servlet.http.HttpServletRequest cannot be resolved

    来源于:http://blog.csdn.net/dingqinghu/article/details/8805922 http://yl-fighting.iteye.com/blog/140946 ...

  2. 项目导入时报错:The import javax.servlet.http.HttpServletRequest cannot be resolved 解决方法

    Error: The import javax.servlet cannot be resolved The import javax.servlet.http.HttpServletRequest ...

  3. 项目导入时报错:The import javax.servlet.http.HttpServletRequest cannot be resolved

    Error: The import javax.servlet cannot be resolved The import javax.servlet.http.HttpServletRequest ...

  4. 编译时提示软件包 javax.servlet.http 不存在 import javax.servlet.http.HttpServletRequest;

    编译时错误:软件包 javax.servlet.http 不存在import javax.servlet.http.HttpServletRequest; 解决办法:把servlet-api.jar加 ...

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

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

  6. The import javax.servlet.jsp.JspException cannot be resolved

    问题描述   重新更换了 Apache Tomcat 的版本,在 Eclipse 中项目报错信息:The import javax.servlet.jsp.JspException cannot be ...

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

    我的方法:是缺少servlet的引用库,解决如下 1.工程右键-properties->java build path 2.在java build path的libraries tab页中选择A ...

  8. 【The type javax.servlet.http.HttpServletRequest cannot be resolved】解决方案

    是缺少serverlet的引用库,解决如下 1.工程右键-properties->java build path 2.在java build path的libraries tab页中选择Add ...

  9. The import javax.servlet.jsp.JspWriter cannot be resolved' error

    Add servlet-api.jar and jsp-api.jar from Tomcat 6.0 library to ecipse project.

随机推荐

  1. 学习mysql

    一 概述 1.什么是数据库 数据库就是数据的仓库. mysql是对数据库进行存储和指令操作的软件.这类软件成为数据管理系统Database Management System. 2.mysql的安装和 ...

  2. Linux下查看某个软件安装路径

    1:如果包是通过yum或者rpm方式安装 [root@localhost yum.repos.d]# rpm -qa //找出系统所有的包,找到对应的文件名 [root@localhost yum.r ...

  3. stty--设置终端线

    stty - chang and print terminal line settings SYNOPSIS stty [-F DEVICE | --file=DEVICE] [SETTING]... ...

  4. Pyhton 学习总结 21 :fileinput模块

    fileinput模块可以对一个或多个文件中的内容进行迭代.遍历等操作.该模块的input()函数有点类似文件readlines()方法,区别在于前者是一个迭代对象,需要用for循环迭代,后者是一次性 ...

  5. grunt///////////////////z

    1. 前言    替代grunt的其他工具,例如gulp.Gulp未来有可能替代grunt,现在市场占有率不如grunt. 本文讲解grunt入门,以及讲解grunt最常用的几个插件的使用.我录制的视 ...

  6. APP-SQLAP-10771:Could not reserve record (匹配PO时候)

    ,) SID, substr(C.SERIAL#,,) SERIAL#, substr(B.,) OBJ_NAME, C.STATUS, C.USERNAME, c.action, C.USER#, ...

  7. install cygwin

    make clean

  8. yield return的作用

    测试1: using UnityEngine; using System.Collections; public class test1 : MonoBehaviour { // Use this f ...

  9. Win10系统Start Menu上的图标莫名消失

    今天在工作过程中,突然有测试的同事给我报来一个问题.她是这么描述的“执行完XXX工具之后,在Start Menu找不到图标了.” 针对问题本身: 1,是执行完XXXX工具之后? 2,Start Men ...

  10. SSH 无密码远程执行脚本

    ssh无密码登录及远程执行脚本要使用公钥与私钥.linux下可以用用ssh-keygen生成公钥/私钥对,下面我以CentOS7为例. 测试环境:机器A(10.0.224.80):机器B(192.16 ...