Before going for differences, first let us see how the three Servlet, Observe the hierarchy and understand the relationship between the three. The main difference between GenericServlet and HttpServlet is that the GenericServlet is protocol independent and can be used with any. hi whats the main difference between Generic & httServlet??.
|Published (Last):||25 April 2017|
|PDF File Size:||5.5 Mb|
|ePub File Size:||5.50 Mb|
|Price:||Free* [*Free Regsitration Required]|
In general, you’d extend HttpServlet to implement an application’s web layer. It is abstract, so it is not to be directly instantiated.
Eventhough the HttpServlet does not contain any abstract methods, it is declared as abstract class by the Designers to not to allow the anyone to create an object directly because a Servlet object is created by the Servlet Container. In order to httpservle this complexity, we have GenericServlet and HttpServlet for next level.
Difference Between GenericServlet and HttpServlet
Bela James 9 March at That is, in HttpServlet, the service is concrete method. Servlet is a server-side web technology. It is usable class to extend if you some day have to write servlet for protocol other than HTTP.
Servlet is an interface which contains five abstract methods in order use servlet we have to provide an implementation for all these five methods, which is a headache. HttpServlet gives a blueprint for Http servlet and makes writing them easier.
Azik Abdullah 6, 12 63 It contains 5 abstract methods and all inherited by GenericServlet and HttpServlet. Anonymous 25 February at For example we take four number 23,21,50,10 out of these number we have The other four methods inherited from the Servlet interface have implementations in GenericServlet. Observe the hierarchy and understand the relationship between the three involved in multilevel inheritance.
Anonymous 16 November at As a result of checking through the net and meeting techniques that were not productive, I thought my life was done.
Servlet vs GenericServlet vs HttpServlet
Diference 16 January at Furthermore, the immediate superclass of HttpServlet is GenericServlet. He is currently working as a technology manager at a leading product and web development company. It is developed by Apache Software Foundation.
Bob Gilmore 5, 10 40 In this class, only one abstract method service exist. It has five abstract methods, and GenericServlet and HttpServlet inherit these methods.
Umesh Prajapati 19 October at Generic servlet has abstract method service ,http servlet is a sub class of generic servlet,so http berween also contains abstract method service.