Pro Spring MVC: with Web Flow – Sample Application Fails To Start

Update (1-8-2012): Please download the most recent version of the sources from either the GitHub repository or from the Apress website. This version fixes the problem with the project dependencies.

You arrived at this page because of 2 reasons. First you bought Pro Spring MVC: with Web Flow for which I would like to thank you and I really hope it is a valuable addition to your book shelve. Secondly you are trying to run the sample application which ships with the book but the application fails to start/deploy (and sometimes also has some compilation errors), for this we are really sorry and we apologize for the inconvenience that has given you. We also read books and we know that there is nothing so frustrating as a book with source code and the sources don’t compile or the sample doesn’t work.

STS Startup Error

The Problem

For some reason the Gradle tooling we choose sometimes fails to correctly resolve and reference projects in the same workspace, this is either due to some error in our build file (despite all the testing we did) or it is an error/undocumented feature of the Gradle Tooling. However as a reader it doesn’t really help you. (See GRADLE-2409).

When one now deploys the application you get a nice stack trace as shown on the left (click for larger image). This is, believe us, not the experience we wanted you to have. Following are a couple of workarounds which can help you get it to work, meanwhile we will also try to fix the build script so that the tooling resolves correctly. You can always get the most recent sources from our GitHub repository this you can always fork or download as a ZIP file.

Continue reading “Pro Spring MVC: with Web Flow – Sample Application Fails To Start”

Securing Spring Web Flow

Well that is the title of the presentation I just gave at the NL-JUG 2007 conference. The presentation was about the Spring Web Flow solution we created to secure flows. The presentation can be found and the conference website. The code is available in the JIRA under issue SWF-93 but for your convenience also available for download (press the link on the bottom of this post).

The presentation went well, there were some nice questions and a little bit of discussion. So my conclusion was that it was a nice presentation. I will blog about using this security solutions shortly. However for now I have a conference to attend.

WebFlow Security

Spring Web Flow Tag Library

A while ago we started to use Spring Web Flow. We needed to convert our old WizardForms and Multi SimpleFormController screens to the Spring Web Flow ones. After converting about three jsp’s I got fed up with the hidden fields, the submit buttons with the specified name. Generating urls with a flowExecutionKey and eventId was even worse. Also after making al those typos in flowExecutionKey I decided to create a taglibrary which can write different HTML tags needed in Spring Web Flow.
Continue reading “Spring Web Flow Tag Library”

Using multiple validators in Controllers and FormAction

On a job I did recently we did a lot of refactoring the old (web) application, they used an abundance of (Web) Frameworks, we reduced it to 1 (well actually 2 if you count Spring Web Flow 🙂 ).

They already had a lot of Controllers and Validators build and also somewhere some custom validation logic in the desired classes. One thing I noticed is that they had a few command objects which had an emailaddress or telephone number. For each of those objects they also wrote a suitable Validator. Copying and pasting all the logic concering emailaddress validation each time, or even worse reinvented the logic.
Continue reading “Using multiple validators in Controllers and FormAction”