详解 问题:HttpServlet cannot be resolved to a type
HttpServlet cannot be resolved to a type
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
在文章 Java中REST API使用示例——基于云平台+云服务打造自己的在线翻译工具 中从IBM Bluemix上下载的Java示例代码,导入到Eclipse之后,出现以上错误信息!
错误原因:
Eclipse是刚刚安装的,还没有配置服务器运行环境!
解决办法:
1、首先要安装一下Tomcat;
通常是下载一个zip压缩包,解压一下就可以了;
2、Eclipse中点击Window菜单,选择Preferences
3、在左侧展开Server,选择Runtime Environment,右侧点击Add按钮
4、在弹出的窗口中选择你的Tomcat版本
5、点击“Browse”按钮选择Tomcat的安装位置,选择合适的JRE版本,点击Finish按钮完成。
通过上面的步骤,上面的错误都全部解决了,如果你的项目还显示 有错误,就需要考虑其它原因了。
可以参考:xxx cannot be resolved to a type 错误解决方法
相关文章
使用Postman传递arraylist数据给springboot方式
这篇文章主要介绍了使用Postman传递arraylist数据给springboot方式,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教2021-12-12spring boot使用thymeleaf跳转页面实例代码
本篇文章主要介绍了spring boot使用thymeleaf跳转页面,实例介绍了thymeleaf的原理和介绍,有兴趣的可以了解一下。2017-04-04Java线程队列LinkedBlockingQueue的使用
本文主要介绍了Java线程队列LinkedBlockingQueue的使用,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧2023-06-06
最新评论