What are you getting in the browser when you use get in the form.
I guess you might be getting a blank page in browser, reason being you have not overriden the doGet() method of HttpServlet Class.
Kindly let us know if you see some behavior other than this while using get form method.
It has nothing to do with init parameters. The default action of the methods in HttpServlet is to throw a "not supported" exception. Only those methods that you override (doGet, doPost etc.) will be allowed.
Joined: Nov 05, 2007
ok.. that helped !
I guess I was looking at the wrong file because I was pretty sure I was getting this error after overriding the Get Method and using the method "GET".
And sorry about the indentation.
The default action of the methods in HttpServlet is to throw a "not supported" exception. Only those methods that you override (doGet, doPost etc.) will be allowed.
I tested and found that you are correct. but I am curious to know why does it give not supported exception. doGet is called from the service method and HttpServlet already contains and doGet method implementation. Does this protected implementation of doGet in HttpServlet always throws this exception whenever accessed ?
Joined: Mar 22, 2005
I am curious to know why does it give not supported exception.
The HttpServlet class can't know what a servlet that extends it should do for any particular method, so it makes sense to report an error for all methods that have not been overridden.