why are using HttpServlet in realtime projects and why are
not using Genericservlet

Answers were Sorted based on User's Feedback



why are using HttpServlet in realtime projects and why are not using Genericservlet..

Answer / arun sharma

HttpServlet is Http Protocol Specific whereas Generic
servlet is protocol independent and as we know that on
world wide web only http protocol exists thats why most of
the servlets are developed using HttpServlet class. but id
we want proocol independent servlet in that case we develop
servlet using GenericServlet class.

Is This Answer Correct ?    13 Yes 1 No

why are using HttpServlet in realtime projects and why are not using Genericservlet..

Answer / prakash

Generic servlet is a abstract class which is not
implementing service() method,to serve the client requests
service method has to execute. and also generic servlet is
containing all general statements,and methods which are
changing by protocol wise.

But HttpServlet is a Http protocol specific class,it is also
one abstract class,eventhough all methods got implemented it
is qualified as abstract class to restrict the creation of
objects. Httpservlt class is implementing service() method
to serve the client requests.
so we are using HttpServlet in realtime projects.

Is This Answer Correct ?    8 Yes 1 No

Post New Answer

More Servlets Interview Questions

why business logic written using servlets not in jsp. Jsp used for presentation purpose. serlvet used for coding business logic and controller logic. Reason for using servlets in business logic.

5 Answers  


Explain their methods? Tell me their parameter names also have you used threads in servlet?

0 Answers  


What exception should be thrown when servlet is not properly initialized?

0 Answers  


How multiple simultaneous requests can be handled by servlets?

2 Answers  


Explain the difference between GET and POST methods?

6 Answers  






What are setComment and getComment methods in Cookies?

2 Answers  


What are different ways for servlet authentication?

0 Answers  


Can we use servlets in JavaScript?

2 Answers  


What are the security issues in Servlets?

2 Answers  


What is difference between Forward() and sendRedirect() methode?

14 Answers   Polaris,


how the jsp page can be regenerated?

2 Answers   HCL,


difference between sendredirect,forward and url rewritting

5 Answers   Patni, TCS,


Categories