The container calls the appropriate service method based on the http method in the request it receives (i.e. doPost() for a POST, doGet() for a GET...). In your code, if a call is made to the doPost() method, it, in turn, calls the doGet() method. This is done when you want your
servlet to do the same thing regardless of whether it is called by a POST or a GET request.
“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook