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:

TheStijn said...

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

thanks

Anonymous said...

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

Anonymous said...

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

Anonymous said...

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

Anonymous said...

Its great. Thanks for all the work put into it

Anonymous said...

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

Anonymous said...

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

Anonymous said...

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

kanchaba said...

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

Anonymous said...

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

Эли said...

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

Anonymous said...

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

Ryan Berg said...

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.

Kenneth Ko said...

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!

Anonymous said...

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

Charles Goddard said...

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?

Anonymous said...

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.

Steven said...

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

Marcos Vinícius said...

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

Thanks ;)

Anonymous said...

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.

Anonymous said...

Wow, thanks!

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

Best regards,
Antti
Finland

Anonymous said...

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

preet said...

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

Oleg said...

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.

chitra said...

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

Anonymous said...

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.

Anonymous said...

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

Xaeryan said...

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

Xaeryan said...

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

Replica Watches said...

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..

Rebeccah said...

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

Chris Serra said...

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

terry said...

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

fxhawaii said...

I suppose every person must read it.

Anonymous said...

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

Susan said...

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.

ASK CARZ said...

Thru Wall

Air Conditioner

Travel Trailer Air Conditioner Units
Auto Air

Conditioner

Dyson

Air Conditioner Reviews

Upright

Window Air Conditioner

Slider

Window Air Conditioner

15 000 Btu

Air Conditioner

As Seen

On Tv Air Conditioner

Energy Efficient Air Conditioner Unit
Smallest

Btu Air Conditioner