why are extending GenericServlet and why are extending
HttpServlet explain?

Answers were Sorted based on User's Feedback



why are extending GenericServlet and why are extending HttpServlet explain?..

Answer / mahesh

There are some reasons are exited they are as follows
-->GenericServlet is protocol independent where as HttpServlet is protocol dependent .
-->Due to the un implementation of http protocol GenericServlet will not provide any flexibility for the developers to specify different types of request at client mechine.
i.e. If you specify any type of request at client mechine like get,post,head.....when at server side GenericServlet able to process all this request as a normal request by calling service().
-->Due to the imlementation of HttpProtocol in HttpServlet,vl provide very good flexibility for the request at client mechine .
i.e. If we specify the request types like get,post...client mechine then HS vl execute doGet(),doPost().....respectivly at serverside.

Is This Answer Correct ?    7 Yes 0 No

why are extending GenericServlet and why are extending HttpServlet explain?..

Answer / dinesh goud

why bcoz,this GenricServlet and HttpServlet are implementing the Servlet interface..............

Is This Answer Correct ?    3 Yes 0 No

why are extending GenericServlet and why are extending HttpServlet explain?..

Answer / rama

iam not satisfied this answer .u r gave good answer,but it
is not expline entrilly.

Is This Answer Correct ?    3 Yes 1 No

why are extending GenericServlet and why are extending HttpServlet explain?..

Answer / venu bandla

because be extending generic servlet we can access only
common methods of servlet interface,and we fourcefully
access the httpservlet methods by type casting the
servletRequest and ServletResponse objects into
httpServletRequest and HttpServletResponse.so this procedure
is not recommended because of redendent code.so we are
extending the HttpServlet class

Is This Answer Correct ?    1 Yes 0 No

why are extending GenericServlet and why are extending HttpServlet explain?..

Answer / dinesh goud

with out extending those servlets,we have to write all the methods in Servlet interface..............In order to write all the methods in Servlet interface.we go for extending GenericServlet and HttpServlet............

public UserServlet implemetns Servlet
{
provides bodies for all methods;
}
public UserServlet extends GenricServlet
{
provides bodies for methods ur wish and well
}

Is This Answer Correct ?    3 Yes 3 No

why are extending GenericServlet and why are extending HttpServlet explain?..

Answer / nishidh soni

if the request from the is HTTP specific the we are extending HTTPServlet and if the request if from protocol independent then we are extending GenericServlet

Is This Answer Correct ?    0 Yes 0 No

why are extending GenericServlet and why are extending HttpServlet explain?..

Answer / srikanth reddy

interface servlet
{
7 abstract methods
}
generic servlet extends servlet{
it override 6 above abstract methods except service method
}
httpservlet extends generic servlet
{
it hsa 7 methods and 2 service methods in this servlet

Is This Answer Correct ?    3 Yes 6 No

Post New Answer

More Servlets Interview Questions

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

14 Answers   Polaris,


What is cookies in servlet with example?

0 Answers  


How can we perform any action at the time of deploying the project?

0 Answers  


What do you mean by cgi and what are its drawbacks?

0 Answers  


What are some advantages of storing session state in cookies?

0 Answers  






How ThreadSafe page attribute will be working in Servlet as well as in JSP?Automatically ThresdSafe is true in JSP so service method will be destroy in each and every request or not?so how thresd will handle srevice method?

1 Answers   AZTEC,


how can you give alias to servlets?

1 Answers  


In jsp custom tags from child tags to how many levels of parent tags you can acess

1 Answers   Bosch,


What do you mean by chaining in servlet?

0 Answers  


Explain the servlet filter.

0 Answers  


i am bca student,give me suggest for bright future

18 Answers   BSNL, Future Considerations,


How can you run a servlet program?

0 Answers  


Categories