HTTP Status 405 - HTTP method POST is not supported by this URL另外一种原因

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HTTP Status 405 - HTTP method POST is not supported by this URL另外一种原因相关的知识,希望对你有一定的参考价值。

看了网上的其他解决办法,发现自己的问题并不是那些原因造成的;经过排查还是找到了原因:

@WebServlet("/Ce")
public class Ce extends HttpServlet {
    
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

    }

    
    protected void doPost(HttpServletRequest request, HttpServletResponse response,int id)
            throws ServletException, IOException {
        doGet(request, response);
    }

}

我在doPost后面多写了一个参数int id,可能是在调程序的时候加上去的吧,粗心的我啊,希望大家不要像我一样的粗心!

以上是关于HTTP Status 405 - HTTP method POST is not supported by this URL另外一种原因的主要内容,如果未能解决你的问题,请参考以下文章

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

转 Js 跨域CORS报错 Response for preflight has invalid HTTP status code 405

Js 跨域CORS报错 Response for preflight has invalid HTTP status code 405

HTTP Status 405 - Request method 'GET' not supported

HTTP Status 405 - HTTP method POST is not supported by this URL另外一种原因

JSP登录系统点提交出错HTTP Status 405 - HTTP method POST is not supported by this URL