Lets review what happens when a
servlet gets a request.
1. Before your service method gets called, the servlet container constructs a request object and a response object. The request object is populated with the HTTP headers parsed out of the request. We are talking lots of
String operations here, with all header lines parsed and placed in a Map.This is time consuming.
2. Your service method (the one inherited from DefaultServlet) looks at the method - GET or POST or whatever and calls your custom doPost or doGet with those request and response objects.
How much time do you think this one string comparison takes compared to all that parsing?
Bill