javax.servlet。*无法解析为某个类型 [英] javax.servlet.* cannot be resolved to a type
问题描述
我正在运行ubuntu 14.04和eclipse Kepler(预装了java ee模块),我是第一次开发Dynamic Web App,它总是说javax.servlet.xyz无法解析为某种类型请帮助我包括一个屏幕我的错误页面的快照!
I am running ubuntu 14.04 and eclipse Kepler (with java ee modules preloaded) , I am developing Dynamic Web App for first time, it always says javax.servlet.xyz cannot be resolved to a type please help I am including a screen snapshot for my error page!
推荐答案
Eclipse中只需要两件事情:
Only two things are required in Eclipse for this:
一个
在Eclipse中,窗口 - >首选项 - >服务器 - >运行时环境
指定您的Web服务器或应用程序服务器路径,通过添加新服务器运行时环境。
In Eclipse, Window -> Preferences -> Server -> Runtime Environment
Specify your Web Server or Application Server path, by adding a "New Server Runtime Environment".
更新
最初,Eclipse提供的服务器运行时环境很少,如:
Initially, there are only few Server Runtime Environments available with Eclipse like:
- Apache
- 基本
- ObjectWeb
另外请注意,您可以添加更多服务器适配器使用链接 在服务器运行时环境对话框屏幕中下载其他服务器适配器
。
On an additional note, you can add more Server Adapters using the link Download additional server adapters
in Server Runtime Environments dialog screen.
两个
在项目属性中(右键单击项目 - >属性),在Java Build Path中添加库服务器运行时
。
将服务器运行时添加到项目库时,将添加 servlet-api.jar
和 jsp-api.jar
jars to project dependencies。
In Project Properties (Right Click on Project -> Properties), in Java Build Path, add Library "Server Runtime"
.
On adding Server Runtime to Project Library will add servlet-api.jar
and jsp-api.jar
jars to project dependencies.
这篇关于javax.servlet。*无法解析为某个类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!