Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Can anyone say why developers extends HTTPSERVLET

  Asked By: Fabiana    Date: Dec 22    Category: Java    Views: 1028
  

Could you tell me why developers extends HttpServelet rather than Generic
servlet and why service( ) in Generic Servlet is abstract

Does Servelet's have any Disadvantage?

Share: 

 

3 Answers Found

 
Answer #1    Answered By: Burk Martin     Answered On: Dec 22

see the hierarchy.
javax.servlet.servlet
^
|
javax.servlet.Genericservlet
^
|
javax.servlet.Httpservlet

httpservlet will be used for http protocal related. u mean to perform
get,post,head,put,trace,delete and options handling.

its an extention of genericservlet with http related functionalities.

 
Answer #2    Answered By: Hubert Taylor     Answered On: Dec 22

this is about abstraction level u prefer like writing a soket program using
assembly or
using java. They're in huge different levels of abstraction.

HttpServlet uses post,and get methods to process http request in high level
abstrated
way. It's to easy. Do u write any code about HTTP, do u know HTTP rfc
specification?

service  method abstract, because they want u override this method whenever and
whereever u extend their class, an also u cannot process anything without
overriding this
method. Cause abtracted HTTP parser analizer workers(whatever u say) will call
your class' service method whenever a request came to your servlet  descriptor
that defined on
your web server. unless u override this method, there will be an internal server
error.

 
Answer #3    Answered By: Lurlene Fischer     Answered On: Dec 22

Could you tell me why developers  extends HttpServelet rather than Generic
servlet and why service( ) in Generic servlet  is abstract

Does Servelet's have any Disadvantage?

 
Didn't find what you were looking for? Find more on Can anyone say why developers extends HTTPSERVLET Or get search suggestion and latest updates.




Tagged: