在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 ...
随机推荐
- mrunit for wordcount demo
import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.had ...
- [译]OpenStack Object Storage Monitoring
注:翻译的不完整,主要是有些地方翻译后反而妨碍理解,有些不知道怎么翻,anyway,需要时拿来用用也是可行的,顺便共享啦.欢迎提意见. 一个OpenStack Object Storage(OSOS) ...
- Geoserver发布Oracle数据
在Geoserver安装包中,默认是不能发布Oracle数据库里的数据的,只能发布postgis.shp等数据,详细如截图: 如果想发布oracle数据,得安装相应版本的关于oracle数据源的插件, ...
- poj-1083-Moving Tables(hdu-1050)
Moving Tables Time Limit: 1000MS Memory Limit: 10000K Total Submissions: Accepted: Description The f ...
- hdu-4452-Running Rabbits
/* Running Rabbits Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
- 【温故而知新-Javascript】使用事件
1. 使用简单事件处理器 可以用几种不同的方式处理事件.最直接的方式是用事件属性创建一个简单事件处理器(simple event handler).元素为它们支持的每一种事件都定义了一个事件属性.举个 ...
- UESTC 919 SOUND OF DESTINY --二分图最大匹配+匈牙利算法
二分图最大匹配的匈牙利算法模板题. 由题目易知,需求二分图的最大匹配数,采取匈牙利算法,并采用邻接表来存储边,用邻接矩阵会超时,因为邻接表复杂度O(nm),而邻接矩阵最坏情况下复杂度可达O(n^3). ...
- 我发现:在StackOverflow上拯救歪果仁十分有意思!
菊长:火星特工们!今天是周五了,大家有什么提议? BeJavaGod:报告菊长!我发现,在StackOverflow上拯救歪果仁十分有意思! 噗哈哈,时不时遇到问题会使用到StackOverflow, ...
- 在WPF控件上添加Windows窗口式调整大小行为
起因 项目上需要对Canvas中的控件添加调整大小功能,即能在控件的四个角和四条边上可进行相应的拖动,类似Windows窗口那种.于是在参考以前同事写的代码基础上,完成了该功能. 代码实现 Adorn ...
- Apache Shiro权限框架在SpringMVC+Hibernate中的应用
在做网站开发中,用户权限必须要考虑的,权限这个东西很重要,它规定了用户在使用中能进行哪 些操作,和不能进行哪些操作:我们完全可以使用过滤器来进行权限的操作,但是有了权限框架之后,使用起来会非常的方便, ...