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
Describe some assignments that are executed by servlet container?
Why doesn’t a servlet include main()?
Explain the working of service() method of a servlet.
What is the use of servlet context?
How do you find out what client machine is making a request to your servlet
What are the disadvantages of storing session state in cookies?
Should I override the service() method?
What is servlet initializer?
How can you use a servlet to generate a plain text instead of html?
What are the differences between forward() method and sendredirect() methods?
What is httpservlet and how it is different from genericservlet?
What is the difference between using getSession(true) and getSession(false) methods?
How forward () method is different from send redirect () method?
Explain how does JSP handle run-time exceptions?
Why is Servlet so popular?