Spring Web Flow Java One 2007 Demo

When Sun scheduled my JavaOne 2007 session on Spring Web Flow for Friday, the last day of the conference, I wasn't sure what to expect. I was honored to have been accepted again this year, but I wondered what I would see in terms of attendance presenting on the last day of the 4-day conference.
I could not have been more pleased with how things transpired. When I checked in at speaker setup on Thursday 800 people had pre-registered for my Friday session. Fifteen minutes before my talk was to begin the room had reached that number. In the end, 1000 JavaOne attendees came to room 307-310 of the Moscone center to experience an adrenaline-powered Spring Web Flow test drive.
Spring Web Flow Test Drive
In this blog I am hoping to re-create some the most exciting parts of my JavaOne Web Flow presentation. Checkout the screen cast below to see what was personally the most exhiliterating part of the presentation for me–building out a search flow from the ground up for deployment in a Java Server Faces (JSF) environment.
This search flow lets you enter some search criteria, see some results, execute a new search, and browse a result's details if you choose (existing WebFlowians will recognize this as the JSF version of the familiar Phonebook sample application).
When watching the screen cast note how Web Flow manages all navigation and state for the application, while standard JSF components care for view rendering and model data binding. Also note even when I screw something up I can quickly fix it and get back to work because I never need to restart my server or switch my editor.
The Spring IDE visualization of this flow is below:
Get the code for this demo here. If you are using Eclipse with Web Tools you can import phonebook as an Dynamic Web Project and fire up the webapp inside your IDE.
Spring Web Flow at Spring One
Be sure to catch Erwin's talks on Spring Web Flow at SpringOne on June 20th-22nd. He'll be presenting two very interesting sessions that show how to put this product to work.
Eric Hauser says:
Added on May 18th, 2007 at 10:12 amKeith,
How do you have Eclipse setup so that it allows you not to restart your web application when you change your Spring configuration? I use the Maven Jetty plugin so I do not have to restart across JSP changes, but I still have to reload the web app when I change any of the XML files or code. Are you just using WTP w/Tomcat? Thanks in advance.
Rob Hasselbaum says:
Added on May 18th, 2007 at 1:30 pmNo sound? It would be much more helpful with an audio commentary. I'm not sure what I'm looking at here.
Keith Donald (blog author) says:
Added on May 18th, 2007 at 8:26 pmEric,
I am just using Eclipse 3.2.2 with Web Tools 1.5.3 and the Phonebook project configured as a Dynamic Web Project deploying to the Tomcat server inside the IDE.
Since in this demo I only update my flow definition logic I have never have to restart. Registered flow definitions eligible for execution are recompiled automatically when their source files change.
Had I needed to change my middle tier application context, I would have needed to restart. We are working on enhancing Spring and specifically Springs web application development solutions to support changing Java code and Spring configuration without a restart–watch for the Spring OSGI project as a key enabler to this.
Rob,
In this demo I am building out a search flow that allows you to enter some search criteria, view your results, try a new search, and browse details about a particular result if you choose. This is the familiar Phonebook sample application which is also included in the product release and has walkthrough documentation here: http://www.ervacon.com/products/swf/intro/index.html
I hope the fact SWF supports building out a task in a linear fashion very nicely aids in naturally picking up on what is going on in this demo even without audio. I do agree an audio commentary would be helpful and will try to update this video with a new version for you.
Cheers,
Keith
Keith Donald (blog author) says:
Added on May 20th, 2007 at 10:54 pmRob,
The embedded video has been updated with an audio commentary. There is also a backing music score (I have been listening to the new Ennio Morricone tribute CD lately and picked the track he is best known for)
Bala says:
Added on May 22nd, 2007 at 10:07 amHi Keith,
I get this error:
Cannot find common-targets.xml imported from build.xml
when I try to build your linked sample phonebook application with ant. Looks like the *target.xml files are missing?
Bala
Keith Donald (blog author) says:
Added on May 22nd, 2007 at 12:18 pmBala,
Indeed, the build.xml file is a bit misleading in this zip file. The project as I zipped it up is not designed to be built with ant. It's designed to be directly imported into a IDE and ran from there. If you use Eclipse the import should work automatically (I'm using version 3.2.2), and if you have Eclipse Web Tools installed (I'm using version 1.5.3) you'll be able to deploy to a server from inside the IDE. I'd recommend that environment for evaluating this sample.
The Phonebook sample in the main Web Flow distribution of course builds from Ant as well.
Hope this helps!
Keith
Carl Fooks says:
Added on May 22nd, 2007 at 3:39 pmKeith,
Is it possible to post a version of the screen cast without the music, please? I'm hard of hearing and I find it very difficult to hear what you're saying above the music (it all meshes into one for me).
Thanks very much in advance!
Cheers,
-Carl
Trainingbrett says:
Added on May 23rd, 2007 at 5:37 pmVery cool video
Thanks for the Post.
Peter
Michael Stacey says:
Added on May 25th, 2007 at 12:18 pmGreat post, Keith.
Would it be possible to do something like this for the Jave University talk you gave as well? I tried to connect with you on the exhibit floor but our schedules never meshed and I was really interested in seeing you finish the design you started, especially the JMS and SOA parts you didn't have time to get to.
Michael
G. says:
Added on May 26th, 2007 at 4:05 amNice one. But the music is sooo 70's. Common it is not a western.
2nd remark : why clicking on the "back" button of the browser, and not on the "Back" button on the page. Does recursivity work?… I shall check taht one
Anyway, very nice presentation. I like that kind of videos because you can see something really working. Seeing it working gives a lot of confidence, when you just begin to work with that framework .
Erwin Vervaet says:
Added on May 27th, 2007 at 3:59 amG.: He uses the browser back button because that's typically what causes problems in these kinds of apps.
The whole also handles recursivity. Try it online:
http://spring.ervacon.com/swf-phonebook/
Erwin
G. says:
Added on June 2nd, 2007 at 1:18 amThanks for your answer and for this cideo that really made me wanting to try swf.
I really like the fact that you can work on your flows at runtime.
First you code your services. No tomcat at all. Then you implement the flows with almost no tomcat reloading. This is nice!
I have to keep on digging.
Thanks!
Matthias Wessendorf says:
Added on July 10th, 2007 at 12:50 pmA well done video entry!
terry says:
Added on September 25th, 2007 at 9:19 amHere!I can't pass the 'id' to the subflow!!! I have working on this point two days! Can you help me,please!!! Except this everything work well!! At first time I do this case on spring-webflow 1.0.4 Now is spring-webflow2.0-m1.I use Tomcat6.x,myfaces1.20.
terry says:
Added on September 25th, 2007 at 12:08 pmAnother question~~how could I debug webflow in jetty6~!When I change the config file of webflow I will get :java.lang.NullPointerException!! Then jetty can't work well with webflow's page!
Waiting your next excellent video~:)
askreddy says:
Added on October 31st, 2007 at 1:37 pmHi keith,
Spring Web Flow is compatible with Struts 2 or not. I want to Spring Web Flows with Struts 2. Please give reply
Thanks
open source reader says:
Added on November 15th, 2007 at 11:25 amYes it Spring web flow is compatible with Struts2 see http://cwiki.apache.org/S2PLUGINS/spring-webflow-plugin.html
Nicolas says:
Added on December 4th, 2007 at 8:31 amSorry
Herakles says:
Added on December 4th, 2007 at 11:45 amCool.