HTTP method GET is not supported by this URL 问题解决
来源:互联网 发布:建设银行纸黄金软件 编辑:程序博客网 时间:2024/05/18 02:06
此时我们访问:http://localhost:8080/../hello?name=test
就会出现:
HTTP Status 405 - HTTP method GET is not supported by this URL
出现错误的原因:
1,继承HttpServlet的Servlet没有覆写对应请求和响应的处理方法即:doGet或
doPost等方法;默认调用了父类的doGet或doPost等方法;
2, 父类HttpServlet的doGet()或doPost()方法覆盖了你重写的doGet或doPost等
方法;
只要出现以上的情况之一,父类HttpServlet的doGet或doPost等方法的默认实现是
返回状态代码为405的HTTP错误表示:对于指定资源的请求方法不被允许。
解决方法:
1,子类覆写父类的doGet或doPost等方法;
2,在你的Servlert中覆写doGet或doPost等方法来处理请求和响应,不要调用父类
HttpServlet的doGet() 和 doPost()方法,即:
将doGet()方法中的 super.doGet(req, resp);
改为:this.doPost(req , resp) ; 可以解决问题
- HTTP method GET is not supported by this URL 问题解决
- HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- 405 HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- Servelet:HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- 405: HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- 405--HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- android系统键盘隐藏与显示问题
- 如何解析从webservice返回的json
- ios代码行数统计
- 有关CMOS RAM的分析及读取
- SQL Server 2005 int与datetime数据类型的存储结构说明
- HTTP method GET is not supported by this URL 问题解决
- python 中两个list是否有相同元素的办法?
- dirent d_type类型
- C#多线程学习(一) 多线程的相关概念
- 页面跳转方法总结
- 认真想想,自己要的到底是什么
- 什么是宿便?
- nginx强制使用https访问(http跳转到https)
- ThreadPoolExecutor运转机制详解