what is diff between generic servlets and httpservlets

what is diff between generic servlets and httpservlets

what is diff between generic servlets and httpservlets

View Answers

May 7, 2012 at 3:36 PM

Difference between GenericServlet and HTTPServlet:

1)GenericServlet belongs to javax.servlet package while HttpServlet belongs to javax.servlet.http package.

2)GenericServlet is an abstract class which extends Object and implements Servlet, ServletConfig and java.io.Serializable interfaces. HTTPServlet is an abstract class which extends GenericServlet and implements java.io.Serializable.

3)The direct subclass to GenericServlet is HttpServlet. To write a GenericServlet you need abstract service() to be overridden. A subclass of HttpServlet must override at least one method of doGet(), doPost(),doPut(), doDelete(), init(), destroy(), getServletInfo().

4)GenericServlet is a protocol-independent servlet while HTTPServlet is a protocol dependent servlet.









Related Tutorials/Questions & Answers:
the servlets
what is diff between generic servlets and httpservlets  what is diff between generic servlets and httpservlets   Difference between GenericServlet and HTTPServlet: 1)GenericServlet belongs to javax.servlet package
Diff between ArrayList and Vector?
Diff between ArrayList and Vector?  What's The Difference between ArrayList and Vector Classes and Can you give me a simple Program for set and List Interface
Advertisements
diff between spring and struts in java
diff between spring and struts in java  diff between spring and struts in java
diff between encapsulation and abstraction code
diff between encapsulation and abstraction code  diff between encapsulation and abstraction code
Difference between JSP and Servlets
Difference between JSP and Servlets  What is the difference between JSP and Servlets ?   JSP is used mainly for presentation only. A JSP can only be HttpServlet that means the only supported protocol in JSP is HTTP
diff between encapsulation and abstraction code with output
diff between encapsulation and abstraction code with output   diff between encapsulation and abstraction code with output
diff between encapsulation and abstraction code with output
diff between encapsulation and abstraction code with output   diff between encapsulation and abstraction code with output
diff between encapsulation and abstraction code with output
diff between encapsulation and abstraction code with output   diff between encapsulation and abstraction code with output
ModuleNotFoundError: No module named 'what-the-diff'
ModuleNotFoundError: No module named 'what-the-diff'  Hi, My... 'what-the-diff' How to remove the ModuleNotFoundError: No module named 'what-the-diff' error? Thanks   Hi, In your python
Diff between Struts1 and struts 2? - Struts
Diff between Struts1 and struts 2?  What are the difference in between Struts 1 and Struts 2?  Hi Gaurav There is a big difference... describes some differences between struts1 and struts2 Feature Struts 1 Struts 2
What is the difference between the >> and >>> operators?
What is the difference between the >> and >>> operators?   hi, What is the difference between the >> and >>> operators? Thanks
what is the difference between extends and implements
what is the difference between extends and implements  difference between extends and implements
what is the difference between extends and implements
what is the difference between extends and implements  difference between extends and implements
What is the difference between PHP4 and PHP5?
What is the difference between PHP4 and PHP5?  What is the difference between PHP4 and PHP5
What is difference between a PROCEDURE & FUNCTION ?
What is difference between a PROCEDURE & FUNCTION ?  What is difference between a PROCEDURE & FUNCTION
What is the difference between $message and $$message?
What is the difference between $message and $$message?  What is the difference between $message and $$message
what is the Difference between weblogic and jboss?
what is the Difference between weblogic and jboss?  what is the Difference between weblogic and jboss
what is the difference between pop and oop
what is the difference between pop and oop  what is the difference between pop and oop
What is the difference between hibernate and spring
What is the difference between hibernate and spring  Hi, What is the difference between hibernate and spring. Thanks
What are the differences between EJB and Spring
What are the differences between EJB and Spring   Hi, What are the differences between EJB and Spring Thanks
What is the difference between a constructor and a method?
What is the difference between a constructor and a method?  Hi, What is the difference between a constructor and a method?   Hi, I have found a good link of Java program related to difference between constructor
Diff between Runnable Interface and Thread class while using threads
Diff between Runnable Interface and Thread class while using threads  Diff between Runnable Interface and Thread class while using threads   Hi Friend, Difference: 1)If you want to extend the Thread class
Diff between Runnable Interface and Thread class while using threads
Diff between Runnable Interface and Thread class while using threads  Diff between Runnable Interface and Thread class while using threads   Hi Friend, Difference: 1)If you want to extend the Thread class
What is difference between the java and javascript?
What is difference between the java and javascript?  What is the difference beteen the java and javascript?   Hello Friend, Read HereADS_TO_REPLACE_1 Thanks
What is the difference between a JDK and a JVM?
What is the difference between a JDK and a JVM?  Hi, What is the difference between a JDK and a JVM? Thanks,   Hi, JDK is stand... to compile your source files using a JVM. For more difference between JDK and JVM
What is difference between Path and Classpath?
What is difference between Path and Classpath?   hi What is difference between Path and Classpath? thanks   Hi, The Path & Classpath are used for operating system level environment variales. We mostly use Path
What is difference between TRUNCATE & DELETE
What is difference between TRUNCATE & DELETE   What is difference between TRUNCATE & DELETE?   Hi, The DELETE command is used to remove rows from a table. A WHERE clause can be used to only remove some rows
What is the difference between JPA and Hibernate?
What is the difference between JPA and Hibernate?  Hi, I have seen... it for enterprise applications and there is good demand in market. What is the difference between JPA and Hibernate? What a beginner should learn? Thanks   Hi
What is difference between the java and javascript?
What is difference between the java and javascript?  What is the difference beteen the java and javascript?   Hello Friend, Difference:ADS_TO_REPLACE_1 1) Java is a Object Oriented programming language developed
What is the difference between IN and BETWEEN, that are used inside a WHERE clause?
What is the difference between IN and BETWEEN, that are used inside a WHERE clause?  What is the difference between IN and BETWEEN, that are used inside a WHERE clause?   Hi, The BETWEEN clause is used to fetch a range
What is the difference between ereg_replace() and eregi_replace()?
What is the difference between ereg_replace() and eregi_replace()?  What is the difference between eregreplace() and eregireplace
What is the difference between the functions unlink and unset?
What is the difference between the functions unlink and unset?  What is the difference between the functions unlink and unset
What are the difference between abstract class and interface?
What are the difference between abstract class and interface?  What are the difference between abstract class and interface
What’s the difference between include and require?
What?s the difference between include and require?  What?s the difference between include and require
what is the difference between distributed application and web application?
what is the difference between distributed application and web application?  what is the difference between distributed application and web application
What is the difference between JSF, Servlet and JSP?
What is the difference between JSF, Servlet and JSP?  What is the difference between JSF, Servlet and JSP
What are the differences between require and include, include_once?
What are the differences between require and include, include_once?  What are the differences between require and include, include_once
What’s the difference between load() and get()?
What?s the difference between load() and get()?   Hi, What?s the difference between load() and get()? thanks
What is difference between singleton and prototype bean?
What is difference between singleton and prototype bean?  Hi, What is difference between singleton and prototype bean? Thanks
what is difference between objectan primitive? - Java Beginners
what is difference between objectan primitive?  whatis difference between object and primitive
What are difference between Bean Factory and Application Context ?
What are difference between Bean Factory and Application Context ?  Hi, What are difference between Bean Factory and Application Context
what is the difference between productList==null and productList.size()==0
what is the difference between productList==null and productList.size()==0  what is the difference between productList==null and productList.size()==0? here productList is of type LIST
What is the difference between the Boolean & operator and the && operator?
What is the difference between the Boolean & operator and the && operator?   Hello, What is the difference between the Boolean & operator and the && operator? thanks
What is difference between Core Java and Advanced Java?
What is difference between Core Java and Advanced Java?  Hi, I want...? What is difference between Core Java and Advanced Java? Thanks   ... topics includeing JSP and Servlets which is necessary to develop web applications
What is difference between Core Java and Advanced Java?
What is difference between Core Java and Advanced Java?  Hi, I want...? What is difference between Core Java and Advanced Java? Thanks   ... topics includeing JSP and Servlets which is necessary to develop web applications
what is the difference between jdk 1.4 and 1.5 and 1.6
what is the difference between jdk 1.4 and 1.5 and 1.6  what is the difference between jdk 1.4 and 1.5 and 1.6   Java 1.4 Features...: automatic conversions between primitive types (such as int) and primitive wrapper
what is the difference between the eclipse and myeclipse - IDE Questions
what is the difference between the eclipse and myeclipse  what is the difference between the eclipse and myeclipse  Hi Friend, Difference: Eclipse is an IDE or platform for developing, whereas MyEclipse
What is the difference between component and tag in JSF?
What is the difference between component and tag in JSF?  Please let me know,becaus i am new to jsf and am confusing
servlets
servlets  How do you communicate between the servlets?   We can communicate between servlets by using RequestDespatcher interface and servlet chaining
What is the difference between GET and POST method?
What is the difference between GET and POST method?  In PHP, both GET... there is a lots of difference between the both. Can anyone please explain...;difference between get and post method in PHP POST method is more secure than GET

Ads