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??.

Author: Nikomuro Goltishura
Country: Bosnia & Herzegovina
Language: English (Spanish)
Genre: Politics
Published (Last): 13 July 2008
Pages: 195
PDF File Size: 19.59 Mb
ePub File Size: 16.27 Mb
ISBN: 513-1-52609-178-5
Downloads: 41850
Price: Free* [*Free Regsitration Required]
Uploader: Fenos

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.

Eventhough the HttpServlet does not contain any abstract methods, it is declared as abstract class by the Designers to not httpservley allow the Programmer to create an object directly because a Servlet object is created by the system here system is Servlet Container. Biplov Kumar 15 November at For example we take four number 23,21,50,10 out of these number we have Anoushka Sakthi 26 November at generricservlet Stack Overflow works best with JavaScript enabled.


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.

  ART 672-5-1 PDF

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.

Similar Threads

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.