-1

I don't understand why you configure so munch servlet, provided a dispatcherservlet for springmvc, the meaning of other servlet configuration and scenarios

laoqiang
  • 1
  • 2

1 Answers1

0

In Spring MVC Application, we have only DispatcherServlet as FrontController for trapping all the incoming requests to our Application.

  • The DispatcherServlet passes those requests to respective handler/controller classes (POJO classes), according to the configured HandlerMapping.

So, there's no point of user-defined servlets in Spring MVC App.

But, if required you can have multiple DispatcherServlet in your app.

As DispatcherServlet is very flexible. Not only Spring MVC uses it, but also Spring WS and etc.

In general, we declare multiple dispatcher servlets when we need multiple sets of MVC configuration.

When do we need multiple Dispatcher Servlet?