简体   繁体   中英

Is Dispatcher-servlet in Spring MVC - Controller?

If Dispatcher-Servlet is not the controller then who is?

Controller is the one who manages the request and by this definition, it should be the controller.

What is the Model and View in this case?

The DispatcherServlet follows the Front Controller design pattern. The C in MVC refers to the page controller which retreives the data from the model (your services) and passes it to the view for rendering.

The purpose of the DispatcherServlet is to determine the page controller that is supposed to handle the request and coordinates the model and the view

Its an advanced servlet which can handle request mapping , locale resolution , view resolution , content negotiation etc

The Dispatcher servlet is the bit that "knows" to call that method when a browser requests the page, and to combine its results with the matching JSP file to make an html document. How it accomplishes this varies widely with configuration and Spring version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM