刚开始学习Servlet,在Eclipse中新建了一个Servlet,不过页面上报错:

Httpservlet cannot be resolved to a type,显然是Eclipse找不到相应的包,即javax.servlet。

原因:

jdk 里不包括servlet-api.jar 这个包,此包在Tomcat 中存在

项目名--> 右键

Properties--> 选择

Java Build Path--> 选择

Add External JARs--> 选择

把servlet-api.jar 的路径输入即可

Httpservlet cannot be resolved to a type的原因与解决方法的更多相关文章

  1. HttpServlet cannot be resolved to a type 解决办法

    刚开始学习Servlet,在Eclipse中新建了一个Servlet,不过页面上报错: Httpservlet cannot be resolved to a type,显然是Eclipse找不到相应 ...

  2. [转]Null value was assigned to a property of primitive type setter of"原因及解决方法

    原文地址:http://blog.csdn.net/kevinzhangfei/article/details/6995316 在action请求数据的过程中报出"Null value wa ...

  3. JSON.NET的Self referencing loop detected with type的原因以及解决办法

    模型中有循环引用是很常见的.例如,以下模型显示双向导航属性: : public class Category : { : public Category() : { : Products = new ...

  4. Null value was assigned to a property of primitive type setter of"原因及解决方法

    在action请求数据的过程中报出"Null value was assigned to a property of primitive type setter of"错误,搜索之 ...

  5. 新建jsp文件,The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path错误解决方法

    新建一个jsp文件后,有一个错误,The superclass "javax.servlet.http.HttpServlet" was not found on the Java ...

  6. Httpservlet cannot be resolved to a type

    这个问题与上个问题可以说是“错的类似”.解决方案:就是在Tomcat的lib目录下加入servlet-api.jar 即可.

  7. HttpServlet cannot be resolved to a type解决方法

    1:是因为没有加入servlet-api.jar 2:下载网址:http://download.csdn.net/detail/jiuyueguang/5745209 3:然后在项目右键->bu ...

  8. BASE64Encoder cannot be resolved to a type类似问题的解决办法

    我们有时候会碰见在JDK或者其他jar包中提供了某方法或者类,接口,而开发工具仍然报红,无法使用该类或者方法,那是应为我们的编译器没有识别,或者没有支持某些方法或者类 这个时候需要我们手动的开启.具体 ...

  9. composer 报错:Your requirements could not be resolved to an installable set of packages 解决方法

    composer 报错: - Your requirements could not be resolved to an installable set of packages xxxxxxxxxxx ...

随机推荐

  1. utf8与utf-8的区别

    相信很多程序员刚开始也会有这样的疑惑,如题,我也是.    其实,他们可以这样来区分.    一.在php和html中设置编码,请尽量统一写成“UTF-8”,这才是标准写法,而utf-8只是在wind ...

  2. Windows RPC Demo实现

    Windows RPC Demo实现 本文参考并整理以下相关文章 1. <远程过程调用> -百度百科 2. <RPC 编程> -http://www.ibm.com/devel ...

  3. mysql样例数据库employees

    Oracle和sqlserver都有基于员工信息的样例数据库,同样mysql上也是有的. 给出一个连接地址https://github.com/datacharmer/test_db. 下载后直接调用 ...

  4. strong和b

    strong和b标签都是很久以前遗留下来的标签,b标签用来加粗字体,strong用来强调,通常浏览器会把强调的语句加粗,所以二者效果比较近似.语义化愈发受重视以后,b标签退出大众视野,strong依然 ...

  5. ZOJ 3805--解题报告

    题目相关: 3805相关链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5337 在二维的矩形上, 机器通过管道(pipe ...

  6. Set-常用API及详解

    SetAPI: 类别 方法 增 add.addAll 删 remove.removeAll 长 size 遍 iterator 判 isEmpty hashCode 使用与集合大同小异,主要的区别就在 ...

  7. POJ 1797 Heavy Transportation

    题目链接:http://poj.org/problem?id=1797 Heavy Transportation Time Limit: 3000MS   Memory Limit: 30000K T ...

  8. Apache使用mod_deflate模块压缩页面优化传输速度

    可以写为一行,也可以写多行,默认为gzip SetOutputFilter DEFLATE # Restrict compression to these MIME types AddOutputFi ...

  9. URAL 1160 Network(最小生成树)

    Network Time limit: 1.0 secondMemory limit: 64 MB Andrew is working as system administrator and is p ...

  10. ThinkPHP缓存微信公众号access_token

    access_token作为微信的全局票据,在高级接口中需要频繁调用,其有效期为7200秒,即2小时,而微信官方对调用Token的次数有限制(参见接口频率限制说明),获取access_token每日限 ...