JQuery Ajax Request HttpServlet return [http/1.1 405 Method not allowed]

Source: Internet
Author: User

1. Questions
When using jquery's Ajax request Servlet, the success callback function that does not enter Ajax is returned, and the browser console displays [http/1.1 405 Method not allowed].


2. Solution
Most of the online surveys are explained below

Most Web servers, such as Apache, IIS, Nginx, and so on, do not allow static files to respond to post requests, otherwise they will return "http/1.1 405 Method not allowed" error. That is, the error page form method= "POST" is changed to "get" can be


The Ajax request method is changed, both post and get methods are not possible, but the feeling is the post and get request the problem of the way. The final problem is resolved for the following reasons:

The Servlet class that processed the request only rewritten the service method, did not rewrite the Doget and DoPost methods, and after overriding the Doget and DoPost methods, Ajax returned normally.

JQuery Ajax Request HttpServlet return [http/1.1 405 Method not allowed]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.