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 are the differences between servlet context vs servlet config?
What is the
What are the various ways of session supervision in servlets?
What do you mean by cgi?
Describe some assignments that are executed by servlet container?
What is the difference between encodeRedirectUrl and encodeURL?
What is the type of method for sending request from http server?
List out the difference between ServletConfig and ServletContext?
What are life cycle methods of a servlet?
Define servlet mapping?
How can you run a servlet program?
What are the disadvantages of storing session state in cookies?
What are the life cycle methods of a servlet?
Can a jsp be called using a servlet?
What do you mean by servlet?