what is the difference between?when we write the code in
following manner?
class One extends httpservlet
{
}
and
class One extends genericservlet
{
}
Answer Posted / saikiran
We are extending GenericServlet because of 3 Reasons
1.no need to implement 5 metods JVM will take the
responsibility to implement 4 methods init(),deistroy
(),getServletConfig(),getServletInfo()
2.Object to Object communication
2 point is there in java1.0 that is not there because of
when the Object is taking Anther Object Reference that
was unnessarly misusing
finnaly we don't have much benifits and we are
UnNecessarly Incresing the Load on JVM
We are extending HttpServlet Because of
People are Mainly Using Http in Most of the Time for
that sun has given API to Convinient to those People
Note:GenericServlet and HttpServlet are Doesn't knows to
ServletContainer
Because of that was Violationing the
1.Public with NonAbstract
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Why filter is used in servlet?
How to make sure a servlet is loaded at the application startup?
What are the steps that are required to handle the multi-threading?
What is Request Dispatcher?
Which event is fired at the time of setting, getting or removing attribute from application scope?
Why do you use session tracking in httpservlet?
List out difference between a JavaBean from a Servlet?
What is context in servlet?
What are the different mode that servlets can be used?
What is called servlet container?
Write a program to show the functionality of servlets.
Explain the features are in servlet 3?
What are the various ways of session supervision in servlets?
What is a web container and what is its responsibility?
What exactly is a servlet?