title: Should I override service() or doPost()?
body: <p>I was reading a book on servlets, in that book a brief explanation is given about the servlet class, as well as the <code>HttpServlet</code> class.</p>
  
  <p>There is one example for filling in a form- for that form, the servlet's <code>doPost()</code> method is overridden by the class. But for another example of a login form, the <code>service()</code> method is overridden instead.</p>
  
  <p>I want to know why the 2 different approaches- I thought that usually we put our custom code into <code>doPost()</code> (or <code>doGet()</code>) and let <code>service()</code> remain as it is. Is there any reason behind using either one of the 2 approaches, or can I use both approaches in any situation?</p>