Forums Register Login

why HttpServlet class is abstract

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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
We've gotta get close enough to that helmet to pull the choke on it's engine and flood his mind! Or, we could just read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 665 times.
Similar Threads
Is HttpServlet an abstract class or interface?
GenericServlet class and HttpServlet class
Why dont we use GenericServlet
HttpServlet class
Why HttpServlet also implements Serializable?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 03:43:21.