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
What is a servlet context object?
Can we use threads in Servlets?
How can the referrer and the target urls be used in servlet?
what is multiple server?
Can we fetch the attributes related to a servlet on a different servlet?
Once the destroy() method is called by the container, will the servlet be immediately destroyed? What happens to the tasks(threads) that the servlet might be executing at that time?
Is servlet a server side scripting language?
What do you understand by mime type?
Why do we have servlet listeners?
What is servlet lazy loading?
What are the common methods that are included in the http servlet class?
What do you mean by scope object and what are its types?
Can we get PrintWriter and ServletOutputStream both in a servlet?
What do you mean by deployment descriptor?
What is the purpose of requestdispatcher interface?