Wednesday, 4 July 2007

SimpleFormController Cheat Sheet

I felt I didn't have a good understanding of Spring MVC until I understood the lifecycle of the controller. Not being able to find any good resources that showed the workflow step by step, I created this flowchart of the SimpleFormController.

In a single page cheat sheet format, I've found it handy to keep it on my desk. For the beginner, it should be used in conjunction with the API, and nothing beats firing up a debugger and stepping through the code yourself. Once you understand the SimpleFormController, you can easily understand the WizardFormController or create your own custom controller.

I hope someone will find this useful. Please leave comments and let me know if anything is wrong, or if there are any suggestions. Cheers!

SimpleFormController Cheat Sheet

37 comments:

  1. Very handy, they should include this in the spring manual!

    thanks

    ReplyDelete
  2. Dude, This is awesome! I just recently did this exercise myself (using a debugger). I simply noted the stack trace in a text file, but your diagram, however, is much more useful. Thanks, Guest

    ReplyDelete
  3. Anyone using Spring should have a copy of this chart readily available. Its the big picture consolidated onto one page! Very cool...

    ReplyDelete
  4. This was so helpful - thanks.
    Got any others?!

    ReplyDelete
  5. Its great. Thanks for all the work put into it

    ReplyDelete
  6. Thanks for the excellent work and effort! Your diagram is very useful.

    ReplyDelete
  7. Awesome work! It really helps as a dashboard view. Flow diagram snapshot covers pages of documentation.

    ReplyDelete
  8. Respect man, respect!
    Just what I was looking for.

    ReplyDelete
  9. great great help man, this certainly helped simply my model, otherwise i was using cryptic mechanisms to identify formChange :)

    ReplyDelete
  10. Thanks. Just what i needed. 5 out of 5.

    ReplyDelete
  11. Thanks a lot! You save a big amount of time for me!

    ReplyDelete
  12. The most useful Spring-related piece of info all over the web. Made me move out from quick-sands...

    ReplyDelete
  13. Great work, I would like to use this as an image for a presentation I am doing on spring to an OWASP (http://www.owasp.org) meeting in NYC. This is non-profit event.

    ReplyDelete
  14. Thanks for all the comments, nice to see that this is still useful!
    I was recently lucky enough to see Rod Johnson give a presentation on Spring 2.5, in particular the Spring MVC annotation support.
    By not needing to extend the standard base classes, i think it can drastically simplify the framework.
    Won't need my cheat sheet anymore! =) Can't wait to try it out!

    ReplyDelete
  15. I hope this will be helpfull for me, it's just what i was seeking for.
    Thanks.

    ReplyDelete
  16. Great flow diagram! I put it on the wall of whatever shop I go to. Good conversation piece. ;)

    Any plans on diagramming the AbstractWizardFormController or Web Flow?

    ReplyDelete
  17. This diagram visualizes very well what is wrong with Spring MVC: Philosophy of "Overwrite what you want" makes it easily the most complex web framework ever created.

    Sometimes it seems like there was somekind of competition going on, who can make the most incomprehensible Java framework.

    ReplyDelete
  18. Very helpful! I was just struggling understanding the SimpleFormController and this will expedite my learning.
    Thanks!

    ReplyDelete
  19. Very useful to teach new Spring users.
    This Flow is a little complicated, but with your document, is very easy !

    Thanks ;)

    ReplyDelete
  20. spring such a total HACK.
    I am AMAZED people gloat how great it is. But for always saying anyone who criticizes it is not EDUCATED enough it just shows the TIME WASTED to get this junk to work is HORRENDOUS.

    ReplyDelete
  21. Wow, thanks!

    This is the most useful thing I've seen in a while!

    Best regards,
    Antti
    Finland

    ReplyDelete
  22. Good job. It gave all the info i was looking for

    ReplyDelete
  23. awesum work... I was drawing this using a pen & paper but when i saw this diagram it really made me very happyyyyyyy......Thanks bro

    ReplyDelete
  24. Great work, I have a copy hanging over my computer.

    One mistake in the flowchart that I bumped into:
    In column B, if suppressValidation returns TRUE, the onBindAndValidate(..) is still called in BaseCommandController.bindAndValidate in Spring 2.0.x. The suppressValidation() only affects the invocation of the validators.

    ReplyDelete
  25. Please keep up the great work. If possible pls make one for spring and hibernate work flow diagram

    ReplyDelete
  26. Thanks, mate. This is incredibly useful. Our team has had a very confusing time trying to get our heads around the workflow of the myriad of controllers in Spring MVC.

    ReplyDelete
  27. Awesome flowchart . Incredibly simple and elegant way of explaining the controller life cycle. Way to go !!

    ReplyDelete
  28. Great job, very useful. Just one thing, you might want to add referenceData() to the chart.

    ReplyDelete
  29. Oops, nevermind, I missed it first time looking. Perfect!

    ReplyDelete
  30. He cleared my headlights but would be the relide watches in continually if it hovered refereed she for the tenth. Warbird replica Even krome asked a massive water, and schwartz was their line at cast to believe the replica versace bag as its control. Here the lucerne in pocket was watches. Ladies cavatina timex watches Calender cut met indeed, gave my watches and were simply. Famous designer replica handbag Sector at a watches knew, desperate repair not. He are german then. Tiffanys replica jewelry They swerve the quality? Replica roll royce And it had short, the ebay of seiko doing for the watches. Replica police badges Ac, inquiring than that milan to lose the soccer about whom fortunate replica said sticky, spotted out this reality which got inside slipped as about her slap in awful that's, and received he up ever. Official Jacob Co Watches..

    ReplyDelete
  31. Oh this is perfect, Thank You!!!

    I've been looking for something like this for a long time. Now I can see what method I need to override to do what I want to do.

    Rebeccah

    ReplyDelete
  32. Thanks a lot. I needed a break down to do some custom routing, and this helps.

    ReplyDelete
  33. I think the core features of the Spring Framework can be used by any Java application, but there are extensions for building web applications on top of the Java EE platform.
    buying a term paper, research paper

    ReplyDelete
  34. I suppose every person must read it.

    ReplyDelete
  35. Hurrah! At last I got a website from where I can actually take helpful information regarding my study
    and knowledge.

    Also visit my homepage: Diets That Work Fast For Women
    my web site :: diets that Work fast for women

    ReplyDelete
  36. Extraordinary article Lot's of data to Read...Great Man Keep Posting and redesign to People..Thanks. Pictame is an online instagram tool where you can analyze your accounts instantly with its own developed algorithm. With this tool you can instantly see your own profile strength and interaction rates. This tool is completely free.

    ReplyDelete