• Post Reply Bookmark Topic Watch Topic
  • New Topic

Diffence between Genericservlet and HttpServlet

 
nalla srinivas
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did`t get any exact definition from any one. please suggest me
 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have access to the API docs of those classes? Find them and see what they have to say.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After reading the javadocs you may get the idea that it's possible to access servlets with protocols other than HTTP(S) - that is not the case, as http://www.coderanch.com/how-to/java/ServletsFaq#otherProtocols explains.
 
Sumant Mehta
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
GenricServlet is an abstract class,it implements Javax.Servlet interface and provide implementation of all methods (inIt(),destroy()) except service method.it is not necessary to use GenricServlet but if we will not use GenricServlet then we have to provide implementation of all method in our servlet.
HttpServlet extends GenricServlet and code within the HttpServlet is written in such a way that it converts the servletResquest,servletRespopnse in to httpServletResquest and httpServleResponse.
also as we know that server only knows service() method server doesn't know doGet() or doPost() so code within the HttpServlet also convert service() into doGet or doPost() [call doget or doPost from service() method. ]
Sorry for my bad english.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
code within the HttpServlet also convert service() into doGet or doPost() [call doget or doPost from service() method. ]

... as well as all the other HTTP methods besides GET and POST :-)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!