How to call multiple Servlets from a single Servlet?

January 23, 2012

This section is dedicated to my viewers.Here they can ask question and I will be happy to help or redirect to some page what is best suitable for them. 

Hei Animesh,I am bit confused with Multiple servlet call from a single servlet.I saw your post Can you explain a bit more?
Hi Shan, Thank you very much for writing me...What I understood from your mail is something like that image.
For that I googled a bit...I got the best answered post here

The way they coded is written below:

public class Populate_ALL extends HttpServlet {
  public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
     request.getRequestDispatcher("/Servlet2").include(request, response);
     request.getRequestDispatcher("/Servlet3").include(request, response);
     request.getRequestDispatcher("/Servlet4").include(request, response);
I hope this will help you further.

You Might Also Like