Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why we should not override service() ?

 
Harikrishna Gorrepati
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Why all of us are writing doGet() or doPost() methods in our servlet classes instead of just service() method ?
What I am saying is, We can still keep get or post in the HTML along with service() method in Servlet class. I don't see any difference between above 2 lines. HFSJ Page 99 says that We should not override service() method. Why ??
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See this FAQ: http://www.coderanch.com/how-to/java/ServletsFaq#overriding-service

Actually, you should go through the entire Servlet FAQ; it answers a lot of the question you posted.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic