Friday, 14 June 2013

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

Problem:

When i run my servlet by tomcat server, i got error message
HTTP Status 405 - HTTP method POST is not supported by this URL

Solution

The issue is beacause, you made a HTTP post request from jsp form, but you don't have a doPost() method in the servlet to handle it.
you need to add the below line your servlet class.

public void doPost(HttpServletRequest request, HttpServletResponse response)
 throws IOException{
  ....  
 }