45,000 Jobs - Get an Interview Call,  Post Your Resume Here
SURESHKUMAR.NET FORUMS
Registered Member Login:
Not a member? Register today!



Welcome to the SURESHKUMAR.NET FORUMS.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.




Servlets Servlets Interview Questions asked in various Interviews. Professionals are invited to share Answers for these Servlets Interview Questions. Servlets Interview Questions with answers, Experiences, Career Advices, Tips and more.

What is Generic Servlet and how

        

Reply
 
LinkBack Thread Tools Display Modes
Old 15-06-08, 12:58 AM   #1 (permalink)
Senior Member
 
Join Date: Apr 2008
Posts: 13,341
Thanks: 0
Thanked 18 Times in 18 Posts
Rep Power: 136 ShivaniX has a spectacular aura about ShivaniX has a spectacular aura about
What is Generic Servlet and how

What is Generic Servlet and how it is different from Http Servlet?

ShivaniX is offline Offline   Reply With Quote
Old 02-10-08, 10:29 PM   #2 (permalink)
Junior Member
 
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 4 subhashini2020 is on a distinguished road
Re: What is Generic Servlet and how

Generic servlet is the class which implements servelt interface directly.This is not particualr for one protocol.If we want to design our own servelt whcih not particular any protocol we can extend this class.

Httpservlet is the child class of Generic servlet.it is particular to HTTP protcol.If we want to design HTTP based servlet we can extend the Httpservelt class.
subhashini2020 is offline Offline   Reply With Quote
Old 02-10-08, 10:42 PM   #3 (permalink)
Junior Member
 
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 4 subhashini2020 is on a distinguished road
Re: What is Generic Servlet and how

and also generic servlet is abstract class in which service method is not implemented,but in Httpservelt all the methods are implemented but again it is declared as abstract.To avoid object creation for HTTPservlet class ,this class declared as abstract.As methods defined in HTTPservlet class is for generation of error information.So object creation for this class will not make sense.we can extend this class and override methods for generating our required o/p in ourservlet class.
subhashini2020 is offline Offline   Reply With Quote
Old 02-10-08, 11:01 PM   #4 (permalink)
Senior Member
 
Join Date: Feb 2008
Posts: 147
Thanks: 15
Thanked 71 Times in 46 Posts
Rep Power: 10 Sean2 is a splendid one to behold Sean2 is a splendid one to behold Sean2 is a splendid one to behold Sean2 is a splendid one to behold Sean2 is a splendid one to behold Sean2 is a splendid one to behold Sean2 is a splendid one to behold
Re: What is Generic Servlet and how

Generic servlet is protocal independent cannot support cookies httpsession and url writing it does not send large data
Http servlet sends large data and its protocol independent support cookies sessions.

HttpServlet is used to handle only http request & response but whereas Generic servlet can be used to handle any type of requests and responses , such as FTP... The other difference which we can fine between both of them is..

A GenericServlet has a service() method aimed to handle requests. HttpServlet extends GenericServlet and adds support for doGet(), doPost(), doHead() methods (HTTP 1.0) plus doPut(), doOptions(), doDelete(), doTrace() methods (HTTP 1.1).
Both these classes are abstract



Generic servlet doesn’t maintain client session where as httpservlet maintains session.

Generic servlet is the servlet which serves all kind of request but http servlet serves only http servlet. So the later one is protocol dependent.


as part of javax.servlet a class Generic servlet is provided.this class implements the servlet interface,in this class service() is declared as abstract and this class contains the code that is not specific to any protocol

as part of javax.servlet.http a class HttpServlet is provided, this class is sub class of GenericServlet.this class implements the servlet interface and service() is not declared as abstract and this class contains the code that is specific to http protocol
Sean2 is offline Offline   Reply With Quote
Reply

Tags
generic , interview questions , servlet , servlets


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +6.5. The time now is 03:46 PM.

More Interview Questions Here...

Content Relevant URLs by vBSEO 3.3.0