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??.
|Country:||Bosnia & Herzegovina|
|Published (Last):||13 July 2008|
|PDF File Size:||19.59 Mb|
|ePub File Size:||16.27 Mb|
|Price:||Free* [*Free Regsitration Required]|
With the observation, a conclusion can be arrived, to write a Servlet three ways exist. Hence, this indicates the fundamental difference between GenericServlet htrpservlet HttpServlet. GenericServlet makes writing servlets easier. Thus, this is another important difference between GenericServlet and HttpServlet.
Today most web applications use HTTP protocol. Object implements Servlet, ServletConfig, java. That is; a method inherited btween the Servlet interface called the service is an abstract method in GenericServlet. Your email address will not be published. It is the immediate subclass of Servlet interface. Servlet is interface, it defines methods for all the implementations – that’s what interfaces usually do. It handles only simple request. Notify me of new posts by email.
All classes, interfaces, and methods present in the javax. Vishal Wable 8 March at Email Required, but never shown.
Difference between GenericServlet and HttpServlet
If anyone wants to become a Java developer learn from Java Training in Chennai. As a result of checking through the net and meeting techniques that were not productive, I thought my life was done. Ltd and was the first developer in his previous company, Paytm.
Saurabh Dwivedi 6 August at It is abstract, so it is not to be directly instantiated. GenericServlet implements the log method, declared in the ServletContext interface.
Differenc, on the other hand, is the immediate subclass of GenericServlet. Before going for differences, first let us see how the three ServletGenericServletHttpServlet are related, their signatures and also at the end similarities. Notify me of new posts by email. Yes, the abstract method service of GenericServlet is overridden by HttpServlet.
A smart approach is inheriting GenericServlet like using WindowAdapter and overriding its only one abstract method service. Anyone who extends this GenericServlet should override service method.
Bob Gilmore 5, 10 40 GenericServlet implements the log method, declared in the ServletContext interface. It is enough to the programmer to override only this method.