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??.
||26 September 2012
|PDF File Size:
|ePub File Size:
||Free* [*Free Regsitration Required]
GenericServlet class is direct subclass of Servlet interface. More exact information you can find behind the links. A prime difference between GenericServlet and HttpServlet is that the GenericServlet is protocol-independent while the HttpServlet is protocol-dependent. It is really helpful for a newbie like me. Other 4 abstract methods of Servlet interface are given implementation given body. Biram Pal 15 April at Dinesh is passionate about the latest Java technologies and loves to write technical blogs related to it.
GenericServlet is the immediate subclass of Servlet interface. GenericServlet gives a blueprint and makes writing servlet easier.
Also, in GenericServlet, the service method is abstract. Mary Brown 12 October at Object implements Servlet, ServletConfig, java. Only one object is created first time when first request comes, other request share the httppservlet object.
What is the Difference Between GenericServlet and HttpServlet
Jalak Patel 29 April at A programmer who extends the GenericServlet class should override the service method and write the implementation for it. GenericServlet also implements the log method, declared in the ServletContext interface. GenericServlet makes writing servlets easier. It handles only http protocol.
Difference Between GenericServlet and HttpServlet
Anonymous 14 April at Serializable GenericServlet defines a generic, protocol-independent servlet. Moreover, it is possible to write a Servlet using three methods: Kiran Mohan Reddy B 8 November at So, if you extend HttpServlet, you can get the functionality of both.
Rony 2 5 Today most web applications use HTTP protocol. Setter Injection-i am explaning through example hope users like this explaination Suppose we have Class Hello and Class Hello having 4 pro Did you read it? Object implements Servlet, ServletConfig, java.
It is the immediate subclass of Servlet interface. HttpServlet, on the other hand, is the immediate subclass of GenericServlet. Still better way is extending Generiservlet and need not to override any methods as HttpServlet contains no abstract methods. Share to Generixservlet Share to Facebook.
Difference between GenericServlet and HttpServlet – Dinesh on Java
GenericServlet is protocol independent, it means it can accept any protocol request. Before going for differences, first let us see how the three DkfferenceGenericServletHttpServlet are related, their signatures and also at the end similarities. Object implements Servlet, ServletConfig, java. In this class, one abstract method exist: With the observation, a conclusion can be arrived, to write a Servlet three ways exist.