Write a servlet after the access to throw the "HTTP method GET is not the supported by this URL" error, first find a reason, and then find a solution after the network for related reasons.
The problem is that when you build a servlet with Eclipse, the default call to the parent class is automatically added in Doget and Dopost, with the following red Identification code:
/** * @see httpservlet#doget (httpservletrequest request, httpservletresponse response) */ protected void Doget (HttpServletRequest request, httpservletresponse response) throws Servletexception, IOException { //TODO auto-generated method Stub super.doget (Request, response); } /** * @see httpservlet#dopost (httpservletrequest request, httpservletresponse response) */ protected void DoPost (HttpServletRequest request, httpservletresponse response) throws Servletexception, IOException { // TODO auto-generated Method Stub super.dopost (Request, response); }
At this point, if you call a method of the parent class directly, the Doget or Dopost method of the parent class HttpServlet overrides the method you overridden, and the parent class The default implementation of the HttpServlet Doget or Dopost method is to return an HTTP error with a status code of 405, indicating that the request method for the specified resource is not allowed. Removing the method of calling the parent class from the above code solves the problem.
Servlet http method GET is not supported HTTP 405