HTTP Status 405-http method Get isn't supported by this URL

Source: Internet
Author: User

The error is as follows:

type Status

Message HTTP method Get isn't supported by this URL

Description The specified HTTP method isn't allowed for the requestedresource.

Reason:

For http/1.1, the default implementation of methods such as Doget or Dopost of the parent class HttpServlet is to return the HTTP error representation of the status Code 405, source profiling:

protected void Doget (HttpServletRequest req, HttpServletResponse resp)
		throws Servletexception, IOException
	{
		String protocol = Req.getprotocol ();
		String msg = lstrings.getstring ("http.method_get_not_supported");
		if (Protocol.endswith ("1.1"))
			Resp.senderror (405, msg);
		else
			resp.senderror (msg);
	

The request method for the specified resource is not allowed.

Workaround:

Do not invoke methods such as Doget or Dopost of the parent class httpservlet by overriding methods such as Doget or Dopost in an extended servlert to process requests and responses, i.e. remove Super.doget (request, response) and Super.dopost (request, response);

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.