0

I am using a servlet, in that servlet I used a doPost() method by
extending the HttpServlet. then who implement the all remaining methods( doGet,doPut,doHead,doOptions.......)

4
Contributors
10
Replies
11
Views
9 Years
Discussion Span
Last Post by masijade
0

Would you be more specific in what you try to do or what you trying to say? I do not understand what you asking...

0

I am trying to understand the servlets concepts.
Httpservlet is an abstract class then our servlet need to implement to all the methods in that Httpservlet na?

0

No, Servlet is an abstract class, HttpServlet is not. It already has the generic implementations of the methods which the user is free to override.

0

No, Servlet is an abstract class, HttpServlet is not. It already has the generic implementations of the methods which the user is free to override.

r u sure? i am sure that Httpservlet and GenericServlet s are both abstract classes.by verifying kathey sierra book.

0

Yes, I am sorry, I got the facts wrong there. HttpServlet indeed is abstract class but the functions still have their own generic implementation. A class being abstract doesn't mean we _must_ override the functions. Such a requirement is imposed only if the functions themselves are abstract which I don't think they are. Read this.

0

Although (at least according to the "normal" rules for class extension) it will compile just fine without overriding any of them (AFAIK, I haven't actually tried it), it just wouldn't do anything other than return the http error message that the requested http service/method is not supported/implemented.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.