Difference between Generic Servlet and HTTP Servlet?

Answer Posted / sonia

GenericServlet belongs to javax.servlet package
GenericServlet is an abstract class which extends Object and
implements Servlet, ServletConfig and java.io.Serializable
interfaces.
The direct subclass to GenericServlet is HttpServlet.It is a
protocol-independent servlet.
To write a GenericServlet you need abstract service() to be
overridden.


HttpServlet:
HttpServlet belongs to javax.servlet.http package
This is an abstract class which extends GenericServlet and
implements java.io.Serializable
A subclass of HttpServlet must override at least one method
of doGet(), doPost(),doPut(), doDelete(), init(), destroy(),
getServletInfo()

Is This Answer Correct ?    22 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between executing, executequery, executeupdate in jdbc?

560


What is represented by the connection object?

526


Explain the life cycle of jdbc.

639


Why do you use a data source object for a connection?

542


Which is best database for java?

520






What are the steps to connect to the database in java?

520


How to check jdbc connection in linux?

513


What is a jdbctemplate?

520


Why is jdbc used?

522


How can I know when I reach the last record in a table, since JDBC doesn't provide an EOF method?

585


What are different types of ResultSet?

582


Explain the main method?

566


What class.forname will do while loading drivers of jdbc?

498


What is a statement in java?

511


What are the jdbc statements?

559