HTTP Status 405
来源:互联网 发布:python 数组类型转换 编辑:程序博客网 时间:2024/06/08 13:18
翻译自HTTP method GET is not supported by this URL
原文
This is the default response of the default implementation of HttpServlet#doGet(). This means that the doGet() method is not properly being @Overriden, or it is explicitly being called.
You did properly @Override the doGet() method, but you’re still explicitly calling the default implementation for unclear reason.
super.doGet(req, resp);
Get rid of this line and this problem shall disappear.
The HttpServlet basically follows the template method pattern where all non-overridden HTTP methods returns this HTTP 405 error “Method not supported”. When you override such a method, you should not call super method, because you would otherwise still get the HTTP 405 error. The same story goes on for your doPost() method.
翻译
这个错误是HttpServlet#doGet()默认实现方法的默认响应。也就是说你没有正确的重写doGet()方法或者显式地调用了默认的实现方式。
你正确地重写了doGet()方法,但是你显式地调用了默认的实现方式
super.doGet(req, resp);
删掉这行代码应该就没有这个问题了。
HttpServlet基本上遵循模板方法模式(template method pattern)的原理,所有没有重写HTTP的方法都将返回HTTP405错误“方法不被支持”。如果你重写这样的一个方法,不能去调用super.xxx,否则就会得到HTTP 405错误。同理,如果在doPost()中调用super.xxx,也会得到405错误。
- 解决HTTP Status 405
- HTTP Status 405
- SpringMVC HTTP Status 405
- HTTP Status 405
- HTTP Status 405
- HTTP Status 405
- HTTP Status 405
- springMVC:HTTP Status 405
- HTTP Status 405
- HTTP Status 405
- 关于http status 405 post
- Spring MVC HTTP Status 405
- http status
- HTTP::Status
- http status
- HTTP STATUS
- http status
- servlet开发时HTTP Status 405
- 【java】 String str = "test"; 与 String str = new String("test"); 的区别
- ESP8226模块使用笔记
- WinCE系统下,调用系统里控制面板的小工具
- 2017年5月15日
- 在通知栏上玩游戏,Steve iOS 游戏实现思路
- HTTP Status 405
- NDK学习(1)
- 软件体系结构设计|描述与架构风格
- 169. Majority Element
- win10磁盘占用100%导致经常性卡顿问题的解决!
- golang动态规划求解最大连续子数组和
- ns2报错
- cocos lua 突出显示某个物体
- 深度调查“比特币敲诈者”背后藏大型僵尸网络