• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

why HttpServlet class is abstract

 
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As for GenericServlet we have abstract service() method so we can call GenericServlet as abstract class.
But why HttpServlet is abstract class .
Please update me.
Thanx
sanjay
 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess it is something like a marker abstractness(if there is a word like this ).
It tells us that implement one of the doXXX() methods.
 
Sanjay pts
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you are right

b'se when i write class with


public class Myclass extends HttpServlet {
}

and i tries to compile it will not give me an error.
So it means if it was abstract class then it will not compile.
So u r right.

Thanx
sanjay
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
HttpServlet is abstract class because is a *stub* -
a class that implements the pertinent interfaces
with methods that do NOTHING-.
Developers can subclasse the stub, overriding only
those methods that are important to their application.
<!-- After E Gamma an Adapter (Design patterns??) -->
This construct is fine, because it makes easy to create a subclass
(your class) that reacts to *only* the relevant events that are
important to your application.
gruesse,
ser
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic