SpringMVC是内部是怎么工作的

Let us see the flow of spring MVC (3.2). I am not going to describe what is M,V,C hope you already know that mess right ? so lets start with the flow…

Spring MVC 3.2 Execution Flow

Step 1: First request will be received by DispatcherServlet
Step 2DispatcherServlet will take the help of HandlerMapping and get to know theController class name associated with the given request
Step 3: So request transfer to the Controller, and then controller will process the request by executing appropriate methods and returns ModeAndView object (contains Model data and View name) back to the DispatcherServlet
Step 4: Now DispatcherServlet send the model object to the ViewResolver to get the actual view page
Step 5: Finally DispatcherServlet will pass the Model object to the View page to display the result

That’s it 

Just remember this diagram for the interview purpose, i will explain you the practical flow in the first example.

 

 

http://www.java4s.com/spring-mvc/spring-mvc-execution-flow-diagram-spring-mvc-3-2-flow/

你可能感兴趣的:(springMVC)