在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/1409468
使用Myeclipse,将eclipse下的工程复制过来后,发现提示Tomcat 7.0 unbound。缺少Server Runtime。
解决方法如下:
1,File->New->Other->Server->Server(注意在new时,需要勾上Show All Wizards),下一步,选择Apache,Tomcat v7.0 Server,点击finish。
2,项目右键->Properties->Java Build Path->Libraries->Add Library->Server Runtime(MyEclipse incompatible)->next->Tomcat v7.0 Server->Tomcat v7.0 Server
即可。
项目导入时报错:The import javax.servlet.http.HttpServletRequest cannot be resolved
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
在Myeclipse buildpath 加server lib (server runtime)/项目导入时报错:The import javax.servlet.http.HttpServletRequest cannot be resolved的更多相关文章
- 在Myeclipse buildpath 加server lib
把eclipse下的工程复制过来后,发现缺少Server Runtime.本想直接在buildpath里加lib,在Myeclipse里找了一圈,恁是没发现在哪里可以添加,虽然在preference里 ...
- myeclipse 项目运行时报错:运行项目时报错:Could not publish server configuration for Tomcat v6.0 Server at localhost. Multiple Contexts have a"/"
1.先去E:\PLZT\workspace\.metadata\.plugins\org.eclipse.wst.server.core.sever.xml看里面是否存在两个配置是的话删除一个重启服务 ...
- SQL Server management studio使用sa连接时报错与伺服器的连接已成功,但在登入程序是发生错误
使用Sql Server management studio的sa用户连接数据库时,报如下错误 解决方法: 1.使用windows验证登录 2.右键点击连接,点击属性,点击安全性,选择混合验证 3.重 ...
- Myeclipse开发环境下文件中出现的提示错误与解决方法:The import javax.servlet cannot be resolved?
1.开发工具:MyEclipse 2.右击项目 >> Build Path >> Add External Archives (Tomcat >> li ...
- mvc EF框架中,加载外键对象序列化对象时报错 序列化类型为XX的对象时检测到循环引用
Newtonsoft.Json.dll 或者通过->工具->库程序包管理工具->NuGet管理包->联机 输入Newtonsoft或者json.net Newtonsoft.J ...
- 样式加载不出来,浏览器控制台报错:Resource interpreted as Stylesheet but transferred with MIME type text/html
写登录的时候出现的问题,样式时好时坏,浏览器控制台看到的信息是: Uncaught SyntaxError: Unexpected token <Resource interpreted as ...
- myEclipse 导入maven项目时报错
1.先右击项目,build Path 查看是否是某个JAR出了错.去掉无用的JAR 以及修改对应的JDK版本 2.检查src源文件,查看是否是源文件出了错.发现,还真的是 导入的包上面,报错:The ...
- The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path(Myeclipse添加Server Library)
网上找练习的项目导入到myeclipse项目发现每个JSP 出现错误The superclass "javax.servlet.http.HttpServlet" was not ...
- com.sun.xml.internal.ws.server.ServerRtException: Server Runtime Error: java.net.BindException: Cannot assign requested address: bind
在发布 web service 时报错: Endpoint.publish(publishAddress, hl7MessageReveiver); com.sun.xml.internal.ws.s ...
随机推荐
- hdu-4811 Ball
题目链接: Ball Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...
- mac和centos下git安装
mac下面的git安装,这篇文章写的很详细了http://www.cnblogs.com/ccdev/archive/2012/09/12/2682098.html 谈谈centos下的安装.我用的是 ...
- AutoIT脚本的语法特征
这里主要介绍AutoIT的脚本语法特征,包括变量.关键字.宏.设置选项等,详细的语法细节,可以参考其用户手册,也可以去AutoIT中文论坛(www.autoit.net.cn)交流. 1. 变量 Au ...
- Android优化——UI优化(四) 使用stytle
使用style替换背景,防止Activity黑色背景闪过 1.原来的布局 <LinearLayout xmlns:android="http://schemas.android.com ...
- 2014Ember带来怎样的变化?
每隔几个月的时间,Ember的核心团队就会聚在一起讨论目前遇到的各种问题,并决定下一季度需要优先处理的各种事务. 这一次,在俄勒冈州的波特兰,大家聚在一起,商讨2014年的发展方向. 开发工具 &am ...
- js中的return,return true,return false小结
return 函数执行到这句时会终结,并返回调用函数,而且把表达式的值作为函数的结果返回 return false 可以防止默认的事件行为.例如,默认情况下点击一个<a>元素,页面会跳转 ...
- yepnope初体验
真是一个百花齐放的项目,在熟悉代码的过程中,看到各种前端.后端技术,这回又冒出一个yepnope的东东,搜索了一下,不是什么新技术,打开官方网站,已经弃用的通知非常醒目,但仍提供相关文档在github ...
- variable 'xxx' unsafe in 'case'的处理
问题描述: case get(?Player_LoopTaskInfo) of {TargetCnt, TaskStar, TaskExp} -> ok; _ -> throw(" ...
- 微软职位内部推荐-Software Development Engineer 2
微软近期Open的职位: SDE II Organization Summary: Engineering, Customer interactions & Online (ECO) is l ...
- [py] os.system os.popen commands 执行shell
1.仅输出到屏幕,pwd保存的是状态<=====可用于执行shell命令 pwd=os.system(pwd) 2.popen可以保存命令结果 pwd=os.popen('pwd').r ...