If you just override doPost(req,res) alone , you are making an assumption that you support only POST requests. If in case, you call this servlet through browser address link, then you will get "500 Http Method Not Supported" error.
Usually, during development stage, we may want to check if the servlet functions well, by invoking the servlet directly from browser address bar. Making the servlet call doPost() from doGet() is an easy way to overcome this 500 server error (Default implementation) and helps us to proceed with our
testing.
Regards,
Maha Anna