Servlet eroor:HTTP method GET is not supported by this URL
错误提示:
type: Status report
message: HTTP method GET is not supported by this URL
description: The specified HTTP method is not allowed for the requested resource (HTTP method GET is not supported by this URL).
原因:
1,继承自HttpServlet的Servlet没有重写对于请求和响应的处理方法:doGet或doPost等方法;默认调用父类的doGet或doPost等方法;
2,父类HttpServlet的doGet或doPost等方法覆盖了你重写的doGet或doPost等方法;
不管是1或2,父类HttpServlet的doGet或doPost等方法的默认实现是返回状态代码为405的HTTP错误表示对于指定资源的请求方法不被允许。
解决方法:
1,子类重写doGet或doPost等方法;
2,在你扩展的Servlert中重写doGet或doPost等方法来处理请求和响应时 不要调用父类HttpServlet的doGet或doPost等方法,即去掉super.doGet(request, response)和super.doPost(request, response);

谢谢@http://blog.csdn.net/qfs_v/article/details/2545168

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

  1. 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()方法未覆盖. 应写 ...

  2. 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 ...

  3. 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 ...

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

    问题概述: 借助MyEclipse直接建立了一个Servlet类,每次访问这个Servlet都能访问.可自己建立一个Servlet为什么总提示:HTTP Status 405 - HTTP metho ...

  5. 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 ...

  6. HTTP method POST is not supported by this URL

    修改提交页面的提交方式,修改method为get(在index页面中html标签 method="get") 示例代码修改后的代码: <form action="s ...

  7. 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 ...

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

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

  9. Request method 'PUT'/ 'POST' not supported

    起因 在项目中遇到需要进行crud操作的功能,用的是Springboot+MybatisPlus+MySQL+AVue,在通过postman测试接口正确性时遇到此错误. 排查过程 因为项目运行是没问题 ...

随机推荐

  1. Somatic hypermutation (or SHM) is a cellular mechanism by which the immune system adapts to the new foreign elements that confront it (e.g. microbes), as seen during class switching. Somatic hypermut

    Somatic hypermutation (or SHM) is a cellular mechanism by which the immune system adapts to the new ...

  2. 监控、日志、APM整个监控体系思考 我为峰2014 简书作者 4.6092018-11-19 11:39打开App 序言

    监控.日志.APM整个监控体系思考 我为峰2014 简书作者 4.6092018-11-19 11:39打开App 序言

  3. JMeter学习-参数化

    JMeter也有像LR中的参数化,本篇就来介绍下JMeter的参数化如何去实现. 参数化:录制脚本中有登录操作,需要输入用户名和密码,假如系统不允许相同的用户名和密码同时登录,或者想更好的模拟多个用户 ...

  4. MS-MSMQ:百科

    ylbtech-MS-MSMQ:百科 MicroSoft Message Queuing(微软消息队列)是在多个不同的应用之间实现相互通信的一种异步传输模式,相互通信的应用可以分布于同一台机器上,也可 ...

  5. utf-8的中文是一个字符占几个字节

    utf-8的中文是一个字符占几个字节 英文字母和中文汉字在不同字符集编码下的字节数英文字母:·字节数 : 1;编码:GB2312 字节数 : 1;编码:GBK 字节数 : 1;编码:GB18030 字 ...

  6. Mysql迁移由于字符集导致乱码的数据

    有时候会在不注意的情况下创建了字符集为latin1的数据库,导致后续插入的中文显示乱码.这时有两种方法:1.修改数据库与数据表的字符集(只能向上调整,不能向下调整):2.数据迁移.但是两种方法都需要做 ...

  7. Windows .net服务器系列 wmic命令使用示例--Examples of WMIC commands for Windows .NET SERVER Family

    1.0 Method execution: NICCONFIG (Win32_NetworkAdapterConfiguration) WMIC NICCONFIG WHERE Index=1 CAL ...

  8. (四)HttpServletRequest对象(转)

    转自“孤傲苍狼”博客. Web服务器收到客户端的http请求,会针对每一次请求,分别创建一个用于代表请求的request对象.和代表响应的response对象. request和response对象即 ...

  9. LNMP一键环境安装多PHP版本共存的方法

    多PHP版本只支持LNMP模式,LNMPA.LAMP模式下不支持!要使用多PHP先安装多PHP版本,在lnmp1.4源码(lnmp1.3的不行哦)目录下运行:./install.sh mphp 按提示 ...

  10. Win10安装PostgreSQL9.6

    首先去 官网 下载PostgreSQL 9.6. 可以看到最新版已经到11了,但是我们这里还是以9.6.10版本为例进行下载. 下载好之后点击进行安装,安装期间的一些参数如下: 默认的安装位置是C:\ ...