Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Describe some assignments that are executed by servlet container?

1075


Why doesn’t a servlet include main()?

1043


Explain the working of service() method of a servlet.

954


What is the use of servlet context?

1035


How do you find out what client machine is making a request to your servlet

1055


What are the disadvantages of storing session state in cookies?

1146


Should I override the service() method?

1088


What is servlet initializer?

971


How can you use a servlet to generate a plain text instead of html?

1126


What are the differences between forward() method and sendredirect() methods?

1023


What is httpservlet and how it is different from genericservlet?

1095


What is the difference between using getSession(true) and getSession(false) methods?

1041


How forward () method is different from send redirect () method?

966


Explain how does JSP handle run-time exceptions?

1092


Why is Servlet so popular?

1066