Originally posted by Bryan Basham:
Hi all,
The question is "OK" and the answer is the last one: no methods need to be implemented to make the WWServlet class compile.
However, I would argue that this is not a very good question, because it does not measure any reasonable skill or knowledge. A better question would be to ask "Given this servlet class, what would happen if you issued a GET request on this servlet?" Without looking it up, can anyone quess the answer?
-Bryan
[ December 03, 2006: Message edited by: Bryan Basham ]
I think the container will display an error page complaining that there is no doGet(...) method defined.
But I have another question, the specs say :
"A subclass of HttpServlet must override at least one method, usually one of these:
* doGet, if the servlet supports HTTP GET requests
* doPost, for HTTP POST requests
* doPut, for HTTP PUT requests
* doDelete, for HTTP DELETE requests
* init and destroy, to manage resources that are held for the life of the servlet
* getServletInfo, which the servlet uses to provide information about itself "
I do not understand the "at least one method" part here.
Since a class that extends the class HttpServlet without implementing any method will compile.
Can you explain ?