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

What are the different ways we can maintain state between requests?

0 Answers  


how to pass parameter from servlet to html form

4 Answers  


What are the common methods that are included in the http servlet class?

0 Answers  


What are Servlets?

0 Answers  


Name the webserver that is used to run Servlets?

5 Answers  


when the several requests comes to server..how it manage the requests

4 Answers   iGate,


Can we fetch the attributes related to a servlet on a different servlet?

0 Answers  


explain the advantages of servlet life cycle?

0 Answers  


What is the use of attribute in servlets?

0 Answers  


What do you mean by singlethreadmodel interface?

0 Answers  


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

0 Answers  


Who is responsible to create the object of servlet?

0 Answers  


Categories