|
Re: HTTP Status 405 - HTTP method GET is not supported by this URL
Hi,
If client is requesting with get method,then we have to overide doGet() method.otherwise doPost() has to be overidden.If we couldnt predict which method is being used for requesting the servlet,you can overide both doGet and doPost() method.
public void doGet(HttpServletRequest req,HttpRequestResponse res)
throws ServletException
{
doPost(HttpServletRequest req,HttpRequestResponse res);
}
public void doPost(HttpServletRequest req,HttpRequestResponse res)
throws ServletException
{
//write ur logic
}
If we go on this way,we dont need to bother about which method our browser supports or from method the client is requesting.Our servlet can respond for any kind of request coming from client.
Thanks.Comments r welcome.
Regards,
R.P.Karunakaran
|