Android异常总结---type Status report message HTTP method GET is not supported by this URL
2015-11-25 20:44
791 查看
.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).
访问时,一直报错:
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);
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).
访问时,一直报错:
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);
相关文章推荐
- linux网络编程之socket:最简单的回射客户/服务器程序、time_wait 状态
- 关于神经网络的学习
- 黑马程序员——Java基础——网络编程
- snort 之 ProcessTcp()
- Snort之Stream5ProcessTcp()
- Orcad下使用TCL脚本自动生成导线和网络标号
- [python&php 网络编程]完整的socket服务端客户端
- windows检测当前网络环境变化
- CCNA学习笔记一 网络术语简介,OSI七层模型简介
- 神经网络(5)---一些神经网络学习复杂非线性问题的例子(1)
- Tcpdump
- 网络传输文本数据格式JSON
- HBase Coprocessor 剖析与编程实践(转载http://www.cnblogs.com/ventlam/archive/2012/10/30/2747024.html)
- TCP连接的状态详解以及故障排查
- Arduino通过HTTP上传Json数据,树莓派再GET回数据
- TCP粘包和拆包原因
- HTTP协议/IIS 原理及ASP.NET运行机制浅析【图解】
- iOS中protobuf和tcp长链接(AsyncSocket)scoket配合使用
- AngularJS中$http.jsonp跨域请求问题
- 一次完整的Http请求过程