Upgrading to Spring Web Flow 2 for CAS4

For  better or worse, CAS3 has always used Spring Web Flow 1 even after Spring Web Flow 2 came out. As part of CAS4, we’re looking at upgrading to Spring Web Flow 2.  Overall, Spring Web Flow has simplified a lot of stuff.  Calling our service methods directly (for the most part) instead of creating an action to do the same thing is a huge time and codesaver.

I’ve encountered a few weird things along the way that I’m still working the kinks out on:

1. Configuring an External Validator – Spring Web Flow 2 makes it easy to use validators, as long as you follow their conventions (either a method on the model object or a validator that follows particular naming conventions).  I’m looking at leveraging the Javalid framework, which uses annotations on the model objects and one validator.  This should make it easier for deployers to use their own custom credentials objects and keep their validation logic within their class (reducing maintenance).  One problem, its not clear how to register a custom validator that doesn’t conform to the Spring Web Flow 2 conventions.  I’ve asked for information on the forum for anyone interested: http://forum.springframework.org/showthread.php?t=64418

2. Using Simple Domain/Model Objects – In Spring Web Flow 1 you called setupForm on a FormAction and magical stuff happened to instantiate the appropriate objects, etc.  In Spring Web Flow 2 you can merely call evaluate on a method and put the resulting object in the flow or request scope and use that as the model object.  Powerful!  However, its not clear to me how to merely use a simple object (i.e. an instantiation of UsernamePasswordCredentialsImpl).

For those interested in learning more, I’ve found the following resources useful:

0 comments ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment

Spam protection by WP Captcha-Free