Get all updates of Java4s
Follow Us: Email Newsletter

Spring MVC Execution Flow Diagram, Spring MVC 3.2 Flow

Spring-MVC » On Jul 13, 2013 { 71 Comments } By Sivateja

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 2: DispatcherServlet will take the help of HandlerMapping and get to know the Controller 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.

You Might Also Like

  ♦ About Author ♦

Java4s_Author
sivateja@java4s.com
Full Stack( Java/J2EE & UI/UX ) Developer and founder of Java4s - Get It Yourself, A popular Java/J2EE Programming Blog. Sign-up for the Email Newsletter for your daily dose of Java tutorials.

Comments

71 Responses to “Spring MVC Execution Flow Diagram, Spring MVC 3.2 Flow”
  1. ramesh says:

    Dear sir,

    It’s a good site who is learning for the first time.
    Thanks & Regards
    ramesh

  2. sam says:

    hi,, thanks for the info.. well explained

  3. shanmukha says:

    Thanku very much, it is very nice and easy to understand…….

  4. laltu says:

    Hi Sivateja
    when Web Sevices tutorial will come…please confirm me bcoz i am waiting & crazzy…plzzzz. or other wise give any reference to read web services in easy language & concept like your site

  5. Good Its very helpfull to us…

  6. viswanath says:

    Hi,

    For beginners the flow diagram explanation is nice and good. Easy to grab.

  7. ard says:

    Thanks a lot for this introductory article and it helped me lot to understand.

  8. ard says:

    Thanks for posting such a nice article.
    It helped me a lot to get the overview.

  9. OM says:

    Hi can you able to tell me Which dependency is better among setter and Constructor.Why?

  10. sheela V says:

    Its good for beginners:)

  11. ksrirampavan says:

    If suppose we can use spring with structs using our applications for this which controller servlet will be execute please tell me it s one of the intvw question

  12. manohar says:

    what is exact difference between Inversion Of Control(IOC) and Dependecy Injection(DI)

    Please give me answer as soon as possible.

    Thanks in adv..

  13. vignesh says:

    hai .it’s very nice ..now i understood the way of flow…i have one doubt while developing project we have use dependency or jar files which is best…….

  14. sumit says:

    I have a very bad confusion In spring MVC I use println method in every statement of command class setter and getter method I have a home page where I have use a link to go to login page when I click on link then control forward to login page and there is only two fileld I have declared so why getter method of user name and password called 4-4 times ..pls help me out.

  15. MARUTHAM says:

    Thanks lot gaving explanation…can u able to gave a small example with spring mvc and hibernate with annotations

  16. Ganga prasad says:

    Thanks.. it’s a good example for beginners

  17. ravikumar says:

    nice example

  18. Trupti says:

    Very easy to understand.. :)

  19. Tulasi says:

    Thanks, nice example

  20. poocholamannan says:

    its very nice.

    Thanks&Regards

    Poocholamannan.J

  21. Saurabh says:

    Can you please upload content for Spring autowiring with annotation

    Thanks.

  22. Balu says:

    Thank u very much ,easy to understand

  23. Thank u for such a simple and powerful explanation.

  24. mohan says:

    what i can say its awesome ….!and easy to understand…!!

  25. rohit says:

    Thank You very much, nice explaination

  26. Nagarjun says:

    Hi,
    it real good explanation for Java/J2ee develpers

  27. nikhil Jatale says:

    Thanks a lot …… It’s awesome…..

  28. SIva Nadupuru says:

    good exmple for beginners

  29. Shyam says:

    Well explained and easy to understand.

  30. pavan kumar says:

    sir it is good but in interviews they ask Boot strapping of Spring MVC (how internally context loader listener,dispatcher servlet is build for handing request )

  31. Naveen Kumar K R says:

    easy to learn.. great website

  32. subbareddy says:

    Hi,
    It’s very good website for learning java.
    Please add all concepts in spring-mvc

  33. Chidrewar Rahul says:

    Hi,
    it is dam easy for beginners.specially it is very good website for learning hibernate,struts2

  34. cyper says:

    this flow chart is really very intuitive and helpful, thanks
    BTW, is there any updates for spring 4. :)

  35. Ankit says:

    How dispatcher servlet knows which controller has to be executed , if there are multiple controllers present ?

  36. prempaul says:

    Hi,
    All dear this pictorial representation and short Explation are easy and understandable —thanks java4s.com team

  37. Sheik says:

    Hi,

    Thanks for your easy understanding materials
    Please add the JSF materials also.

  38. shilpa says:

    Great tutorial sir , Thanks

  39. shukla says:

    Really very nice explaination……..

  40. Aaaksh says:

    Hi,

    Thanks for your easy understanding materials
    Please add Play Framework materials also.

  41. DurgaRao says:

    hi,

    Thanks for your site .but i am seriously searching about learn DOJO But,is is not explained very well in other sites.So kindly introduce DOJO technoligy in this site .

    Thank you again.

  42. bigginer can understand easily

  43. sravani says:

    your blog is very helpful to all java developers. thank you….

  44. Sumanth says:

    @Sivateja Kandula Hi Siva teja, You are providing very nice tutorial which will help developers a lot. It’s very small but i couldn’t stop my self to say thanks to you buddy.

  45. vicky says:

    Good Explanation

  46. Niraj says:

    Hi Sivateja,

    I have a query. How to disable copy/paste option in text field in jsp.

  47. sri says:

    Maaasth tutorial I LOVE IT

  48. ravi says:

    how to map jsp request to dispatcher servlet

  49. Laxman Singh says:

    Good to understand the flow of spring mvc in project (-_-)

  50. vicky says:

    It was really helpful thanks

  51. Sai says:

    Thank u so much for such a good explanation

  52. suresh says:

    Hi,
    thanks for the explanation it is very much understandable,I want to know in depth about dispatcherServlet and HandleMapping, please suggest me some website.

  53. Amin says:

    This site is really as a person who teaches us similar Directly. I am happy to learn from the site. best of luck

  54. Mammu says:

    Its very good for beginners and easy to grap.

  55. karthik says:

    It is very easy way to understand the flow of the spring mvc….
    thanks to all

  56. prakash says:

    super explanation

  57. Swetha says:

    It is really nice.. Thank u…

  58. vasim says:

    It is good for beginners easy to understand….

  59. lokesh says:

    hi i am regular user of java4us.com….i have one dought by reading this tutorials how to implement in real time java projects

  60. Poornachander says:

    It’s easy to understand..

  61. sainath says:

    its very nice and way of explanation is very good

  62. Ramesh says:

    I think this is the simple and easy explanation for MVC to understand easily

  63. Camellia says:

    Thanks for the good words! Really appreciated. Great post. I ve been commenting a lot on a few blogs recently, but I hadnt thought about my approach until you brought it up.

  64. Ishaq says:

    Nice explanation to understand ..Thank you

  65. Ishaq says:

    Nice explanation for understanding…thanks

  66. Vinita says:

    nicely elaborated the concept. Easy to understand for the beginners.

  67. RajaGuru says:

    simply superb.. good to grab the concept easily..

  68. Mr YashodaKrishna says:

    Hi Siva…..

    Why this much of classes are required …..already existing mvc like (servlets ,JSP, and struts frameworks)
    are having Model View Controller three things only….but here we have no of new classes like Model , ViewResolver, etc…came.

    Could you please explain each thing clearly and which purpose these are userful….

    Many Thanks,

    YashodaKrishna D.
    Java Dev.

  69. Suresh says:

    Thanks for gud explanation……

Name*
Mail*
Website



By posting your answer, you agree to our comments policy.
What would you like to learn today?
Browse these popular technologies
Hibernate spring struts Servlets ajax Log4j jQuery Json Core Java Web Services AngularJs
Most Recent Tutorials
Hibernate_Logo Hibernate Recent Posts Spring_Logo Spring Recent Posts Struts_Logo Struts Recent Posts
Useful Links Current & UpComing Tutorials
Upcoming
  Web Services [ SOAP ], JSP
Contact | About Us | Privacy Policy | Advertise With Us

© 2010 - 2016 Java4s - Get It Yourself.
The content is copyrighted to Sivateja Kandula and may not be reproduced on other websites.