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 the disadvantage of cookies?
How is an application exception handling is done using a servlet?
How to get the server information in a servlet?
Why is servlet used?
What do you mean by default initialization in java servlet?
When to use doget() and when dopost()?
What is cookie? Why is cookie used?
What is URL Encoding?
Explain url encoding?
Is it possible to have a constructor inside the servlet?
Write a servlet to upload file on server.
Why servlet is faster than jsp?
How can we include static files in the jsp page?
What is java servlet session?
How can we achieve transport layer security for our web application?