DIFFERENCE BETWEEN GENERICSERVLET AND HTTPSERVLET PDF

0 Comments

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: Malataur Akit
Country: Trinidad & Tobago
Language: English (Spanish)
Genre: Music
Published (Last): 18 March 2004
Pages: 257
PDF File Size: 5.41 Mb
ePub File Size: 8.71 Mb
ISBN: 926-6-68721-906-5
Downloads: 70018
Price: Free* [*Free Regsitration Required]
Uploader: Goltitilar

Servlet is a Java technology that helps to develop scalable and robust web applications.

Difference Between GenericServlet and HttpServlet

Genericservlt is a platform-independent server-side component. Moreover, it is possible to write a Servlet using three methods: It has five abstract methods, and GenericServlet and HttpServlet inherit these methods.

GenericServlet is the immediate subclass of Servlet interface. That is; a method inherited from the Servlet interface called the service is an abstract method in GenericServlet.

  IC 74HC147 DATASHEET PDF

Similar Threads

The other four methods inherited from the Servlet interface have implementations in GenericServlet. A programmer who extends the GenericServlet class should override the service method and write the implementation for it. Therefore, it is protocol independent. In other words, it can be used when the web was not standardized to HTTP protocol.

Today most web applications use HTTP protocol.

Difference Between GenericServlet and HttpServlet

It is also an abstract class. Furthermore, the immediate superclass of HttpServlet is GenericServlet. HttpServlet overrides the service method geneficservlet GenericServlet. It is possible to replace the service method using doGet or doPost with the same parameters of the service method.

Therefore, when the programmer extends the HttpServlet, he can use the functionalities of both classes. GenericServlet is a class that implements Servlet, ServletConfig and Serializable interface that provide the implementation of all the methods of these interfaces except the service method.

Hence, this indicates the fundamental difference between GenericServlet and HttpServlet. A prime difference between GenericServlet and HttpServlet is that the GenericServlet is protocol-independent while the HttpServlet is protocol-dependent. Also, in GenericServlet, the service method is abstract.

  BRDU MSDS PDF

However, in HttpServlet, the service method is non-abstract. Thus, this is another important difference between GenericServlet and HttpServlet.

Moreover, public abstract class GenericServlet extends java. Object, and implements Servlet, ServletConfig, and, java.

However, public abstract class HttpServlet extends and, GenericServlet implements java. HttpServlet, on the other hand, is the immediate subclass of GenericServlet.

HttpServlet extends GenericServelt and implements a Serializable interface. She is passionate about sharing her knowldge in the areas of programming, data science, and computer systems. Leave a Reply Cancel reply.