207 What is the difference between GenericServlet and HttpServlet | Advanced java Servlets Tutorial

preview_player
Показать описание
Question : What is the difference between GenericServlet and HttpServlet?
GenericServlet HttpServlet
------------------------------ ----------------------------------
1)GenericServlet given as base 1) HttpServlet given as protocol
class for all protocol specific HTTP based class.
servlet classes.

2)GenericServlet is abstract 2) HttpServlet is abstract class
class with one abstract method. with no abstract methods.

3)GenericServlet class based servlet 3)HttpServlet class based servlet
program can handle any protocol program can handle only protocol
based request. HTTP based request.

4)GenericServlet gives only one 4)HttpServlet gives two service(-,-) service(-,-) method to place request methods and seven doXxx(-,-) methods
service(-,-) method to place to place request processing logic.
request processing logic.

5)GenericServlet gives ServletRequest, 5)HttpServlet gives
ServletResponse objects. HttpServletRequest,
HttpServletResponse objects.

6) Does not support to implement 6)Supports to implements all the
Http Cookies, HttpSession with techniques of session tracking OR
Cookies, HttpSession with URL handling or Management(all 4).
Rewriting based Session tracking
techniques.(Only Hidden form fields)

Events in Servlets:
===================

Filters in Servlets:
====================
Рекомендации по теме
welcome to shbcf.ru