HttpServlet无法解析为类型....这是eclipse中的一个错误吗? [英] HttpServlet cannot be resolved to a type .... is this a bug in eclipse?

查看:214
本文介绍了HttpServlet无法解析为类型....这是eclipse中的一个错误吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每件事都很好,我能够运行这个JSP项目,
突然发生了一些事情,而且大多数我的servlet都得到了未解决的错误。

Every thing was fine and i was able to run this JSP project, suddenly some thing happened and mostly all my servlets getting unresolved error.

I知道它,因为无法找到特定的 JAR 文件进行编译..但我的 buildpath 很好,我没有做任何更改..

I know its because specific JAR file cant be found for compilation.. but my "buildpath" is fine and i didnt make any changes..

我遇到了这种情况......

I am stuck in this situation...

尝试

Tried


  1. 多次清理项目

  2. 删除并添加JRE库

  3. 已删除并添加服务器(Tomcat 7.0.23)


推荐答案

您必须为您设置运行时您正在使用的Tomcat安装的Web项目;您可以在项目配置的Targeted runtimes部分中执行此操作。

You have to set the runtime for your web project to the Tomcat installation you are using; you can do it in the "Targeted runtimes" section of the project configuration.

通过这种方式,您将允许Eclipse将Tomcat的Java EE Web Profile jar添加到构建路径。

In this way you will allow Eclipse to add Tomcat's Java EE Web Profile jars to the build path.

请记住,HttpServlet类不在JRE中,但至少在企业Web配置文件中(例如,servlet容器运行时/ lib文件夹)。

Remember that the HttpServlet class isn't in a JRE, but at least in an Enterprise Web Profile (e.g. a servlet container runtime /lib folder).

这篇关于HttpServlet无法解析为类型....这是eclipse中的一个错误吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆