0

as i understand MVC pattern as post MVC question
-

  • the Model is the part of the code that knows things
  • the View is the part of the code that shows the things the Model knows
  • the Controller is the part of the code that gets commands from the user and tells the View what to show and the Model what to know.

in spring-mvc we have DispatcherServlet which acts as controller gets command from client, also we have developer written controllers which serve commands and resolve the view and prepare Model for that view

in spring-mvc what exactly acts as controller DispatcherServlet or developer written controllers

Community
  • 1
  • 1
Melad Basilius
  • 3,847
  • 10
  • 44
  • 81

1 Answers1

1

Your @Controller annotated classes are your controllers. Think of the DispatcherServlet - as the name tells you - as dispatcher to your controllers.This is the same approach other MVC frameworks also choose (like Struts 2).

Ansgar Schulte
  • 463
  • 5
  • 15