问题概述: 借助MyEclipse直接建立了一个Servlet类,每次访问这个Servlet都能访问。可自己建立一个Servlet为什么总提示:HTTP Status 405 - HTTP method GET is not supported by this URL。的确是继承了HttpServlet,而且是重写了它的doGet()、doPost()方法(注意这两种方法一定要写)

public class SearchServlet extends HttpServlet{
  @Override
  protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
  // TODO Auto-generated method stub
  super.doPost(req, resp);
  }
}

解决:问题出来蓝色那行代码,事实上我们是不需要去调用父类的doPost()方法,去掉就可以了!

HTTP Status 405 - HTTP method GET is not supported by this URL的更多相关文章

  1. tomcat报错HTTP Status 405 - HTTP method GET is not supported by this URL

    servlet提交表单,结果出错. 出现HTTP Status 405 - HTTP method GET is not supported by this URL 原因是:1.继承自Httpserv ...

  2. jsp HTTP Status 405 - HTTP method GET is not supported by this URL

    package myservlet.control; import java.io.IOException; import java.io.PrintWriter; import javax.serv ...

  3. HTTP Status 405 - HTTP method POST is not supported by this URL

    出现这个问题, 1.在servlet中没有调用post()方法引起的 2.在serlvet中跳转没有用外跳(response.sendRedirect()) 我的是因为第一种,是没有写dopost() ...

  4. 405 HTTP method GET is not supported by this URL

    孙鑫java web开发详解P285里面提交Get网站弹出提示405 HTTP method GET is not supported by this URL 原因父类doGet()方法未覆盖. 应写 ...

  5. There was an unexpected error (type=Method Not Allowed, status=405). Request method 'POST' not supported

    背景:点击提交按钮ajax请求接口时,报出错误[ Whitelabel Error Page This application has no explicit mapping for /error, ...

  6. doPost或doGet调用出错(状态代码为405) : HTTP method GET is not supported by this URL

    最近做servlet发现了个问题,解决办法记下来: Servlet  eroor:HTTP method GET is not supported by this URL 错误提示: type: St ...

  7. HTTP method GET is not supported by this URL(转)

    源地址:http://blog.csdn.net/qfs_v/article/details/2545168 Servlet  eroor:HTTP method GET is not support ...

  8. HTTP method GET is not supported by this URL

    Servlet eroor:HTTP method GET is not supported by this URL 错误提示: type: Status report message: HTTP m ...

  9. HTTP Status 405 - Request method 'GET' not supported?(尚硅谷Restful案例练习关于Delete方法出现的错误)

    哈罗大家好,最近在如火如荼的学习java开发----Spring系列框架,当学习到SpringMVC,动手实践RESTFUL案例时,发现了以上报错405,get请求方法没有被支持. 首先第一步,我查看 ...

随机推荐

  1. tr 命令用法

     tr a. 替换全部字符 [root@bogon scripts]# tr [a-z] [A-Z]  < /etc/fstab    将读出的结果全部替换成大写字母  (取一行作为展示效果) ...

  2. Arrays的排序算法sort及方法使用

    Java工具包中的Arrays工具类里面有数组的快速排序算法. 源码如下: /** * Sorts the specified range of the array using the given * ...

  3. 使用JBarcode生成一维码

    需要的jar包,只有jbarcode.jar 链接: https://pan.baidu.com/s/1o9oDPB8 密码: x367 public class Main { //设置条形码高度 p ...

  4. spring启动后立即执行方法

    1.方法所属的类继承InitializingBean接口. 2.重写afterPropertiesSet()方法. afterPropertiesSet方法会在bean被初始化时执行. 当bean的作 ...

  5. Python3基础 list insert 在指定位置挤入一个元素

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  6. MongDB 数据库使用技巧及注意事项

    说明 本文记录MongoDB数据库的使用技巧总结,特性发现. 利用TTL特性实现数据定时删除 限制: 你不能创建TTL索引,如果要索引的字段已经在其他索引中使用. 索引不能包含多个字段. 索引的字段必 ...

  7. 在vim中 安装php的xdebug和 vdebug插件, 在vim中进行调试php代码

    在vim中 安装php的xdebug和 vdebug插件, 在vim中进行调试php代码 参考: http://www.cnblogs.com/qiantuwuliang/archive/2011/0 ...

  8. Smartmontools硬盘检测工具

    安装: 下载 命令使用: 查看驱动器信息: $ smartctl -i D: smartctl 6.6 2017-11-05 r4594 [x86_64-w64-mingw32-w10-b17134] ...

  9. 【20K必备知识点】北上广Java开发月薪20K往上,该如何做,需要会写什么

    有人回答说这只能是大企业或者互联网企业工程师才能拿到.也许是的,小公司或者非互联网企业拿两万的不太可能是码农了,应该已经转管理.还有区域问题,这个不在我的考虑范围内,因为除了北上广深杭,其他地方也很难 ...

  10. PTA 根据后序和中序遍历输出先序遍历(25 分)

    7-1 根据后序和中序遍历输出先序遍历(25 分) 本题要求根据给定的一棵二叉树的后序遍历和中序遍历结果,输出该树的先序遍历结果. 输入格式: 第一行给出正整数N(≤30),是树中结点的个数.随后两行 ...