title: servlet route with GET, POST, PUT and DELETE
body: <p>I'm new to Java server-side programming, my question is basically to get to a starting point using Servlets (low level without using spring mvc etc.) and then build my way up from there, coming from node.js background where a route definition would start with a function (<code>app.get(request, response) {}</code>, <code>app.post(request, response) {}</code> etc.), and the function would receive <code>request</code> and <code>response</code> in parameters for one of http methods (GET, POST, PUT, DELETE).</p>
  
  <p>If someone can please help on the starting point of how do I define methods against a route (let's say <code>/users</code>) inside a servlet class that'd map to http methods while providing request and response in it's parameters.</p>
  
  <p>My attempt</p>
  
  <pre><code>public class FirstServlet extends HttpServlet {
  
    public void doGet(HttpServletRequest request, HttpServletResponse response)
      throws ServletException , IOException {
  
  }
  </code></pre>