服务器之家:专注于服务器技术及软件下载分享
分类导航

PHP教程|ASP.NET教程|Java教程|ASP教程|编程技术|正则表达式|C/C++|IOS|C#|Swift|Android|VB|R语言|JavaScript|易语言|vb.net|

服务器之家 - 编程语言 - Java教程 - 详解 问题:HttpServlet cannot be resolved to a type

详解 问题:HttpServlet cannot be resolved to a type

2020-08-29 14:13Java之家 Java教程

这篇文章主要介绍了详解 问题:HttpServlet cannot be resolved to a type的相关资料,需要的朋友可以参考下

httpservlet cannot be resolved to a type

?
1
2
3
4
5
6
7
8
9
10
11
12
13
descriptionresourcepathlocationtype
httpservlet cannot be resolved to a typesimpleservlet.java/javahelloworldapp/src/main/java/wasdev/sample/servletline 15java problem
httpservletrequest cannot be resolved to a typesimpleservlet.java/javahelloworldapp/src/main/java/wasdev/sample/servletline 22java problem
httpservletresponse cannot be resolved to a typesimpleservlet.java/javahelloworldapp/src/main/java/wasdev/sample/servletline 22java problem
servletexception cannot be resolved to a typesimpleservlet.java/javahelloworldapp/src/main/java/wasdev/sample/servletline 22java problem
the import javax.servlet cannot be resolvedsimpleservlet.java/javahelloworldapp/src/main/java/wasdev/sample/servletline 5java problem
the import javax.servlet cannot be resolvedsimpleservlet.java/javahelloworldapp/src/main/java/wasdev/sample/servletline 6java problem
the import javax.servlet cannot be resolvedsimpleservlet.java/javahelloworldapp/src/main/java/wasdev/sample/servletline 7java problem
the import javax.servlet cannot be resolvedsimpleservlet.java/javahelloworldapp/src/main/java/wasdev/sample/servletline 8java problem
the import javax.servlet cannot be resolvedsimpleservlet.java/javahelloworldapp/src/main/java/wasdev/sample/servletline 9java problem
 
 
webservlet cannot be resolved to a typesimpleservlet.java/javahelloworldapp/src/main/java/wasdev/sample/servletline 14java problem

详解 问题:HttpServlet cannot be resolved to a type

在文章 java中rest api使用示例——基于云平台+云服务打造自己的在线翻译工具 中从ibm bluemix上下载的java示例代码,导入到eclipse之后,出现以上错误信息!

错误原因:

eclipse是刚刚安装的,还没有配置服务器运行环境!

解决办法:

1、首先要安装一下tomcat;

通常是下载一个zip压缩包,解压一下就可以了;

2、eclipse中点击window菜单,选择preferences

详解 问题:HttpServlet cannot be resolved to a type

3、在左侧展开server,选择runtime environment,右侧点击add按钮

详解 问题:HttpServlet cannot be resolved to a type

4、在弹出的窗口中选择你的tomcat版本

详解 问题:HttpServlet cannot be resolved to a type

5、点击“browse”按钮选择tomcat的安装位置,选择合适的jre版本,点击finish按钮完成。

详解 问题:HttpServlet cannot be resolved to a type

通过上面的步骤,上面的错误都全部解决了,如果你的项目还显示 有错误,就需要考虑其它原因了。

可以参考:xxx cannot be resolved to a type 错误解决方法

原文链接:http://blog.csdn.net/testcs_dn/article/details/50286073

延伸 · 阅读

精彩推荐