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 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 method GET is not supported by this URL(转)的更多相关文章
- 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()方法未覆盖. 应写 ...
- 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 ...
- HTTP Status 405 - HTTP method GET is not supported by this URL
问题概述: 借助MyEclipse直接建立了一个Servlet类,每次访问这个Servlet都能访问.可自己建立一个Servlet为什么总提示:HTTP Status 405 - HTTP metho ...
- 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 ...
- 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 ...
- HTTP method POST is not supported by this URL
修改提交页面的提交方式,修改method为get(在index页面中html标签 method="get") 示例代码修改后的代码: <form action="s ...
- 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 ...
- HTTP Status 405 - HTTP method POST is not supported by this URL
出现这个问题, 1.在servlet中没有调用post()方法引起的 2.在serlvet中跳转没有用外跳(response.sendRedirect()) 我的是因为第一种,是没有写dopost() ...
- Request method 'PUT'/ 'POST' not supported
起因 在项目中遇到需要进行crud操作的功能,用的是Springboot+MybatisPlus+MySQL+AVue,在通过postman测试接口正确性时遇到此错误. 排查过程 因为项目运行是没问题 ...
随机推荐
- Code Forces 414B 很不错的双手,以促进合规
http://codeforces.com/problemset/problem/414/B 题目挺不错的.留个纪念,活动脑筋不错的题目 #include<iostream> #inclu ...
- XMLHttpRequest创建对象
首先,介绍一下XMLHttpRequest对象,我们都知道Ajax这不是一个简单的技术,但一些技术的融合.XMLHttpRequest这是Ajax中最为核心的技术.假设没有XMLHttpRequest ...
- C#中的Params、ref、out的区别
C# Params params params 关键字可以指定在参数数目可变处采用参数的方法参数. 在方法声明中的 params 关键字之后不允许任何其他参数,并且在方法声明中只允许一个 params ...
- AngularJS应用开发思维之2:数据绑定
在声明式模板中显示数据 因为不能像jQuery一样将DOM操作混在模板里,声明式模板很快让我们变得束手束脚. 一个典型的问题:在声明式模板里怎么显示数据? 假设我们有某人的基本信息,保存在一个json ...
- 当有多于64合乎逻辑的cpu时刻,Windows 下一个Oracle db 实例启动(startup)什么时候会hang(待定)
Bug 9772171 - Database startup hangs on Windows when machine has more than 64 cores [ID 9772171.8] 该 ...
- 关于Android开发中导出jar包后的资源使用问题解决
我们经常遇到一个需求,就是给别人使用我们工程的时候,为了能够屏蔽代码,把代码封装成jar包提供给第三方使用,但是这样我们的资源文件怎么给对方用呢? 其实并不用这么的复杂,下面就介绍一下具体的方法 一, ...
- Android开发之Mediaplayer
Android提供了常见的音频.视频的编码.解码机制.借助于多媒体类MediaPlayer的支持,开发者能够非常方便在在应用中播放音频.视频.本篇博客主要解说在Android平台下怎样播放一个音频文件 ...
- 还在等待漫长的iOS构建过程?来试试通过命令行的方式进行iOS应用快速构建和运行吧
不必多言,Xcode慢得很是众所周知的了.更甚者是,我有时发觉自己太依赖于Cocoa Touch的自动完成功能了,这可是个天使和魔鬼的结合体! 故此我开始去寻觅一个替代的流程来通过命令行来实现我需要的 ...
- 关于SQL Server 2005 的自动远程数据库备份
原文:(原创)关于SQL Server 2005 的自动远程数据库备份 由于项目需要,需要对目标服务器上的数据库每天进行备份并转移,查阅网上的一些帮助,结合自己的实际需要,写了这篇文章,希望对有同样需 ...
- jQuery的ready方法实现原理分析
jQuery中的ready方法实现了当页面加载完成后才执行的效果,但他并不是window.onload或者doucment.onload的封装,而是使用 标准W3C浏览器DOM隐藏api和IE浏览器缺 ...