The servlet dispatcher allows a request to travel from one servlet to other servlets. An alternative for the request dispatcher is to send a redirect. For every new request send, redirect comes back to the network. However, a request dispatcher then occurs within a server.
Example
Let's understand the concept of the request dispatcher with a simple example. Consider the scenario where we have three servlets, each named servlet1, servlet2, and servlet3. In case we don’t use the dispatcher, whenever we request servlet1, the server passes control to servlet1. After that, if we request servlet2, then control comes back from servlet 1 and is passed to servlet2. A server might be in India and a servlet might be requested from America. In this case, for a second request, it must come back to the server (India) and go back to the servlet (America). This option is not good if we have heavy traffic in between each request and response. A solution to this problem is using the dispatcher.