my dog learned polymorphism
The moose likes Servlets and the fly likes HttpServlet Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "HttpServlet" Watch "HttpServlet" New topic
Author

HttpServlet

Ajit Shanbhag
Greenhorn

Joined: Oct 15, 2008
Posts: 7
Can anyone please tell me what is the specific reason for having HttpServlet as an abstract class without any abstract methods?


Ajit Shanbhag
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
Because -in order to be useful- at least one of its methods (generally doGet or doPost) needs to be overridden. Making HttpServlet abstract ensures that it can't be used directly - it needs to be subclassed in order to be instantiated.


Android appsImageJ pluginsJava web charts
Ajit Shanbhag
Greenhorn

Joined: Oct 15, 2008
Posts: 7
Thanks
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: HttpServlet
 
Similar Threads
Qn on HttpServlet
Generic Servlet,HttpServlet
HttpServlet
why HttpServlet is abstract?
HttpServlet class