Bookmark Topic Watch Topic
  • New Topic

why we should not override service() method in a servlet  RSS feed

 
abhijeet srivastava
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Report post to moderator
why we should not override service() method in a servlet instead of overrriding helper method ie; doGet , doPost etc.
 
Rao Raghu
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Report post to moderator
This is in case of servlets which extend HttpServlet. HttpServlet implements Generic servlet. Generic servlet handles standard HTTP requests by dispatching them to the handler methods for each HTTP request type (the doXXX methods like doGet and doPost).
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Report post to moderator
This has been discussed many times; see the FAQ entry here.
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!