Spring Web Flow 1.0 RC4 Released

Releases | Keith Donald | October 05, 2006 | ...
Dear Spring Community,
 
We are pleased to announce that Spring Web Flow 1.0 RC4 has been released.
 

 

Spring Web Flow is a product of the Spring community focused on the orchestration of user interface flow within a web application.

This release contains many improvements and several exciting new features.  We consider it the most stable release to-date and, at last, the release that makes the Spring Web Flow 1.0 final roadmap feature complete.  Spring Web Flow 1.0 final will be released next week with minimal changes.  Between now and then we encourage you to test 1.0 RC4 to help catch any remaining issues before the big 1.0 launch.

Note there are user-affecting changes in this release.  1.0 RC3 or earlier users should review the upgrade guide which outlines these changes in detail.

The new and noteworthy in 1.0 RC4 is an exciting list, including: 

New and Noteworthy

As the final release candidate before Spring Web Flow 1.0 final, Spring Web Flow 1.0 RC4 introduces powerful new features such as render actions (1), evaluate actions (2), set actions (3), flash scope (4), flow execution attributes (5), and always redirect on pause (6). It provides enhanced documentation, better flow definition validation, smart defaults, and a complete custom Spring 2.0 configuration schema (7) for configuring the flow execution engine.

  • (1) Render actions execute application behavior before a response is rendered.  A render action is invoked when a view-state is asked to make a renderable view selection, on entry or on a refresh triggered by a redirect or brower refresh button.  The following example shows a render-action that executes a search of the phonebook before the results view is rendered.

    <view-state id="displayResults" view="searchResults">
        <render-actions>
            <bean-action bean="phonebook" method="search">
                <method-arguments>
                    <argument expression="flowScope.searchCriteria"/>          
                </method-arguments>
                <method-result name="results"/>
            </bean-action>
        </render-actions>
        <transition on="newSearch" to="enterCriteria"/>
        <transition on="select" to="browseDetails"/>
    </view-state>

  • (2) Evaluate actions evaluate expressions against flow execution state.  The expression (OGNL-based by default) can be against any object reachable from the flow execution's root RequestContext, including objects in any scope such as flow scope.  The following example shows an evaluate-action that invokes the "makeGuess" method on the "game" flow-scoped bean:
    <action-state id="makeGuess">
        <evaluate-action expression="flowScope.game.makeGuess(requestParameters.guess)">
            <evaluation-result name="guessResult"/>
        </evaluate-action>
        <transition on="CORRECT" to="showAnswer"/>
        <transition on="*" to="enterGuess"/>
        <transition on-exception="java.lang.NumberFormatException" to="enterGuess"/>
    </action-state>
  • (3) Set actions set attribute values in scope types such as flow scope.  The attribute may be a top-level attribute or a property at a nested property path.  The following example shows a set-action that sets the "fileUploaded" attribute to "true" in flash scope.
    <action-state id="uploadFile">
        <action bean="uploadAction" method="uploadFile"/>
        <transition on="success" to="selectFile">
            <set attribute="fileUploaded" scope="flash" value="true"/>
        </transition>
    </action-state>
  • (4) Flash scope is a new scope type for persisting attributes across a redirect and any refreshes of the view.  When an event is signaled to transition out of the view flash scope is cleared.  The following complete flow definition example shows use of flash scope to expose a "fileUploaded" attribute to the selectFile view-state for displaying a success message after a successful upload.
    <flow xmlns="http://www.springframework.org/schema/webflow"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://www.springframework.org/schema/webflow
                                           http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd">
   
        <start-state idref="selectFile"/>
       
        <view-state id="selectFile" view="fileForm">
            <transition on="submit" to="uploadFile"/>
        </view-state>
   
        <action-state id="uploadFile">
            <action bean="uploadAction" method="uploadFile"/>
            <transition on="success" to="selectFile">
                <set attribute="fileUploaded" scope="flash" value="true"/>
            </transition>
        </action-state>
       
    </flow>
  • (5) Flow execution attributes allow you to set custom attributes that can influence flow execution behavior.  The following example shows an instruction to set the "alwaysRedirectOnPause" attribute to false in a Portlet environment (where redirecting doesn't tend to apply).
    <flow:executor id="flowExecutor" registry-ref="flowRegistry">
        <flow:execution-attributes>
            <flow:alwaysRedirectOnPause value="false"/>
        </flow:execution-attributes>
    </flow:executor>
  • (6) "Always redirect on pauses" gives you default POST+REDIRECT+GET behavior with no special coding. Now by default, when a view state is entered a redirect is issued automatically.  This triggers a refresh to a flow execution URL that remains stable while the conversation is active.
  • (7) The new Spring 2.0 Configuration Dialect greatly simplifies system configuration and provides strong validation and tools support.  Configuring webflow's infrastructure is now as simple as defining two elements, as shown in a complete manner below:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:flow="http://www.springframework.org/schema/webflow-config"
           xsi:schemaLocation="
               http://www.springframework.org/schema/beans
               http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
               http://www.springframework.org/schema/webflow-config
               http://www.springframework.org/schema/webflow-config/spring-webflow-config-1.0.xsd">
   
        <!-- Launches new flow executions and resumes existing executions. -->   
        <flow:executor id="flowExecutor" registry-ref="flowRegistry"/>
       
        <!-- Creates the registry of flow definitions for this application -->
        <flow:registry id="flowRegistry">
            <flow:location path="/WEB-INF/flows/**-flow.xml"/>
        </flow:registry>
       
    </beans>

See the reference manual for more information on these features.  Spring Web Flow 1.0 RC4 further refines the reference documentation, providing 70 pages on SWF usage.  The manual is available on-line in HTML and PDF forms.

Getting Started

One of the best ways to get started with Spring Web Flow is to review and walkthrough the sample applications.  We recommend reviewing all samples, supplementing with reference manual material as needed from the start. Ten sample applications ship with the  release, each demonstratinga distinct set of product features.  These samples are:

  1. Phonebook - the original sample demonstrating most features (including subflows)
  2. Sellitem - demonstrates a wizard with conditional transitions, flow execution redirects, custom text field formatting, and continuations
  3. Flowlauncher - demonstrates all the possible ways to launch and resume flows
  4. Itemlist - demonstrates REST-style URLs and inline flows
  5. Shippingrate - demonstrates Spring Web Flow together with Ajax technology
  6. NumberGuess - demonstrates stateful beans, evaluate actions, and "single key" flow execution redirects.
  7. Birthdate - demonstrates Struts integration
  8. Fileupload - demonstrates multipart file upload, set actions, and flash scope
  9. Phonebook-Portlet - the phonebook sample in a Portlet environment (notice how the flow definitions do not change)
  10. Sellitem-JSF - the sellitem sample in a JSF environment

To build the sample applications for quick evaluation simply:

  1. Extract the spring-webflow-1.0-rc4.zip release archive
  2. Access the projects/spring-webflow/build-spring-webflow directory
  3. Execute the "ant dist" target.
  4. See the "target/artifacts" directory for deployable .war files for each sample as well as expanded war directories.
See the release readme.txt and projects/spring-webflow/spring-webflow-samples/readme.txt for more information on the release archive contents and samples, respectively.

All sample projects are Spring IDE projects directly importable into Eclipse.

Thanks to everyone out there who supported this release.  Spring Web Flow 1.0 is now... finally... just around the corner.

Enjoy!

The Spring Web Flow Team

Spring 2.0 final, with over 10,000 downloads in the first day

Engineering | Rod Johnson | October 05, 2006 | ...

Spring 2.0 went final on Tuesday! This is the product of 9 months of hard work from the Spring team, and huge amounts of user feedback (thanks!) and it's a big step forward.

I promise my next blog will be about something other than download numbers. I've been playing around with some interesting approaches to testing pointcuts in @AspectJ annotations, so I'm hoping next time to post some interesting code.

But we just noticed some pretty amazing figures from SourceForge, so I can't resist posting about them. There were over 10,000 downloads of Spring 2.0 in the first 24 hours! Interest in Spring 2.0 has been building for months--with some users already in production with a release candidate, including a prominent media site in Europe--and I think Keith's brilliant launch page

Spring 2.0 Maven POMs ready

Engineering | Ben Hale | October 03, 2006 | ...

One last Spring 2.0 announcement on a day full of them. The Maven POMs for Spring 2.0 are up in Spring's private repository. If you want to point to it directly check https://svn.sourceforge.net/svnroot/springframework/repos/repo/. If you want to wait, they should be replicated into the Ibiblio Maven repository over the next couple of days.

For those of you who like to browse around with a bit more metadata, the ViewVC interface from SourceForge is a good choice. Remember that you should use the earlier link as a URL for maven, but you can use the later link for browsing.


Updated 10/3 22:03: Added paragraph about ViewVC

Spring 2.0 Final Released

Releases | Rod Johnson | October 03, 2006 | ...

It is our pleasure to announce that the long-awaited final release of the Spring Framework version 2.0 is now available.

Spring 2.0 Released

Download | Documentation | Changelog 

As the leading full-stack Java/Java EE application framework, Spring delivers significant benefits for many projects, reducing development effort and costs while improving test coverage and quality.

This stable, production-grade release comes after 9 months of active development.  In this short time the Spring 2.x series has matured immensely, benefiting from over 150,000 early access downloads across 9 milestone releases, resulting in over 750 JIRA issues resolved, 50 of which introduce major new features.

What's New?

We believe three attributes capture what our users can expect from the Spring 2.0 series: Simple, Powerful, and Proven.


Version 2.0 brings major new simplifications to the framework's overall usage model.  As our existing users know, the heart of Spring is the Bean Container which drives the configuration of your Java and Java EE application.  In version 2.0 many common configuration tasks have been simplified through the introduction of custom Bean Configuration Dialects.  What does this mean to you?

This means you can now:

  • Make your business services transactional in one-line of configuration code.
  • Lookup objects from JNDI in one-line of configuration code.
  • Expose externalized properties to your services in one line of configuration code.
  • Apply consistent exception handling policies to your data access objects with a single annotation.
  • Invoke Stateless Remote EJBs by defining a single configuration tag.  No more custom service locators or business delegates.
Simplifications continue across the modules of the framework, allowing you to:
  • Write parameterized JDBC queries in one line of code.
  • Apply convention over configuration when deploying your Spring MVC controllers.
  • Use Spring JSP tags to reduce your typing when developing input forms.


A major goal of Spring 2.0 is to make the common tasks easier.  Version 2.0 also opens up exciting new doors for solving the harder problems in an elegant manner.  In 2.0 you may:

  • Weave custom behavior into multiple points of program execution using AspectJ's concise pointcut expression language.
  • Receive asynchronous JMS messages with transactional and thread-safety guarantees.  See it live
  • Develop your own Bean Configuration Dialect for your application.
  • Inject objects from custom scopes such as "request" and "session" scope in a thread-safe manner.
  • Invoke Groovy, Beanshell, and JRuby scripts from your Java application.
  • Schedule tasks to run asynchronously with sophisticated threading and pooling options.

Version 2.0 builds on the foundation set by Spring 1.x.  This new release delivers major new functionality while preserving backwards compatability as far as possible.

With over one million downloads since its release in March 2004, Spring 1.x made developing sophisticated applications from plain Java Objects (POJOs) the de-facto standard.  The 2.x series builds on this widely-recognized best-practice to deliver new simplification and power while preserving full compatiblity with the established Spring 1.x series.  Users can expect their upgrade to be straightforward; in most cases, simply a matter of replacing the 1.2.8 JAR files with those included in Spring 2.0.

Enjoy, and thank you

Spring 2.0 represents the cumulative effort of many over the last year.  From the lead developers Juergen, Rob, Rick, and Costin at Interface21, to our supporting partners BEA and Oracle, to the many in the community contributing innovations, patches, documentation, bug reports, and tests--there is a lot of blood, sweat, and tears here.  We truly hope you find this new version as much a joy to use as it was for us to build.  Enjoy, and rest assured: the work doesn't stop here.

Sincerely,

The Spring Team

 


Additional Resources

  • Attend The Spring Experience 2006, the premier conference for the Spring community, December 7th - 10th in Hollywood, Florida.  Register by October 16th to secure the early bird discount for your team.
  • Track future Spring 2.x development with the Roadmap
  • Bookmark this page for the rollout of additional screencasts and code examples showing the new 2.0 features in action.

Exploiting Generics Metadata

Engineering | Rob Harrop | September 29, 2006 | ...

It is a common misconception that I hear when talking with clients that all information about generic types is erased from your Java class files. This is entirely untrue. All static generic information is maintained, and only generic information about individual instances is erased. So if I have a class Foo that implements List<String>, then I can determine that Foo implements the List interface parameterised by String at runtime. However, if I instantiate an instance of ArrayList<String> at runtime, I cannot take that instance and determine its concrete type parameter (I can determine that ArrayList requires type parameters). In this entry I’m going to show you a practical usage for some of the available generics metadata that simplifies the creation of strategy interfaces and implementations that differ by the type of object they process.

A pattern that I see occurring in many applications is the use of some kind of strategy interface with concrete implementations each of which handles a particular input type. For example, consider a simple scenario from the investment banking world. Any publicly traded company can issue Corporate Actions that bring about an actual change to their stock. A key example of this is a dividend payment which pays out a certain amount of cash, stock or property per shared to all shareholders. Within an investment bank, receiving notification of these events and calculating the resultant entitlements is very important in order to keep trading books up to date with the correct stock and cash values.

As a concrete example of this, consider BigBank which holds 1,200,000 IBM stock. IBM decides to issue a dividend paying $0.02 per share. As a result, BigBank needs to receive notification of the dividend action and, at the appropriate point in time, update their trading books to reflect the additional $24,000 of cash available.

The calculation of entitlement will differ greatly depending on which type of Corporate Action is being performed. For example, a merger will most likely result in the loss of stock in one company and the gain of stock in another.

If we think about how this might look in a Java application we could assume to see something like this (heavily simplified) example:


public class CorporateActionEventProcessor {

    public void onCorporateActionEvent(CorporateActionEvent event) {
        // do we have any stock for this security?

        // if so calculate our entitlements
    }
}

Notifications about events probably come in via a number of mechanisms from external parties and then get sent to this CorporateActionEventProcessor class. The CorporateActionEvent interface might be realised via a number of concrete classes:


public class DividendCorporateActionEvent implements CorporateActionEvent {

    private PayoutType payoutType;
    private BigDecimal ratioPerShare;

    // ...
}

public class MergerCorporateActionEvent implements CorporateActionEvent {

    private String currentIsin; // security we currently hold
    private String newIsin; // security we get
    private BigDecimal…

Boston Spring Group First Meeting

Engineering | Mark Fisher | September 25, 2006 | ...

I am very excited to announce that the Spring SIG within the New England Java Users Group will be having our first meeting this Thursday (September 28th, 2006). Ramnivas Laddad (author of AspectJ in Action and Interface21 Principal) will be presenting "AspectJ for Spring Developers". This will be a great chance to learn about the enhancements in AspectJ integration within Spring 2.0.

You can read the details HERE, and be sure to click on the 'Register' link on the left-hand side of the page if you plan on attending.

This group will provide a great forum for "all things Spring" and will be meeting roughly once per quarter initially. I am looking forward to building a community and personally meeting fellow Spring users in the greater Boston area.

A special thanks to NEJUG president Steven Maienza and the NEJUG members who expressed an interest in having a Spring group and put this into motion before I even moved to Boston. Thanks!

Thank you! Spring Framework passes 1 million downloads

Engineering | Rod Johnson | September 22, 2006 | ...

A couple of weeks ago, the Spring Framework project passed 1 million downloads from its home on SourceForge. The true total is probably much higher, as this figure does not include nightly builds or the other sites from which Spring can be downloaded. And, of course, Spring is included in the distributions of a large and growing range of other products. And then there's Spring.NET...

Most important, Spring continues to gain momentum: the numbers are growing very rapidly. The most downloaded version of Spring is the most recent production release, 1.2.8, which has been downloaded 175,000 times…

Long time, no blog

Engineering | Rod Johnson | September 22, 2006 | ...

Welcome to my new blog! I haven't blogged since August 2004, but have been inspired by our new team blog to try to lift my game. I've also been shamed by the blog-energy of my colleagues.

I'm very excited about a lot of topics at the moment, and promise to blog much more often than once every 2 years in future... Stay tuned for my thoughts about Spring 2.0 and beyond, OO design, AOP, and the future of enterprise Java.

In the meantime, I'll share my travel schedule for the next few months (which will at least give me an excuse for not always posting regularly):

  • October 1-6: JAOO conference in Aarhus, Denmark.
  • October 10-11: BEAWorld event in Prague. Always a beautiful city, although Prague is no longer a cheap destination.
  • October 23: Keynote about Spring 2.0 at the Oracle Develop event, a new part of Oracle Open World conference, in San Francisco. This looks set to be a big conference.
  • November: I'm spending most of November in Australia, partly to visit family and friends, and partly because Interface21 has opened a new office there, headed by Ben Alex, Acegi Security lead. I'll be speaking at various events, including Spring User Groups in Sydney and Brisbane, the Sydney JUG, and a forum in Melbourne.
  • November 27-28: JAX Asia conference in Singapore. This is a new conference. The German JAX conferences are big and have interesting content, so I'm looking forward to it. With amazing timing, this is just at the time I was returning to London from Sydney, so I'm literally in the area... There's also a JAX conference in Jakarta, but I'm at the limit of my travel tolerance for the next few months already and just couldn't commit to that.
  • December 7-10: This is going to be the most fun. The Spring Experience, in Hollywood, Florida. This year we expect over 500 developers, and great speakers as usual. Keith is doing a great job of organizing it, along with Jay Zimmerman of No Fluff Just Stuff fame.
  • 11-15 December: JavaPolis in Antwerp. A big European conference, great value for attendees and always has a top speaker lineup--probably because organizer Stephan Janssen seems to know everyone who's anyone in the Java community. And of course Belgium is always worth visiting, if only for the beer. I'm a big fan of Belgian white beer in particular.
Ouch. Even writing that list made me feel tired. Fortunately I have been flying a lot less than usual for the last couple of months, so I've avoided the delays and restrictions here in UK airports. But it's pretty obvious that by late December I am going to be in serious need of a rest...

Spring and Maven Followup

Engineering | Ben Hale | September 18, 2006 | ...

There has been quite a bit of discussion over my recent announcement about Spring and Maven. The discussion is all very good and worthwhile, but I do want to clarify a couple of points that I made.

First and foremost, we are committed to supporting Spring users who are using Maven as their build system of choice. This means we will help ensure accurate POMs are available in the Maven repository with each Spring release starting with Spring 2.0 RC4. That is what the world's most most popular JIRA issue is all about. Nothing more.

The topic of Spring's own internal build system is a…

Spring 2.0 RC4 Released: Heads-up on DTD/Schema Renaming, Scope Attribute

Engineering | Colin Sampaleanu | September 17, 2006 | ...

Spring Framework 2.0 RC4 has been released. This is the last release candidate before Spring 2.0 final, and you may find out more about it from the release announcement itself as well as the JIRA issue list for a complete list of changes in this release.

Possibly the most important thing to watch out for is that this release introduces versioned file/location names for the 2.0 DTD and Schemas (XSDs). This was necessary since the XML bean definition format was significantly enahnced for 2.0, but 1.2.x users still need to be able to refer to the 1.2.8 DTD. Here is an example of using the 2.0 "beans" schema (2.0 ships with a number of other new schemas as well, representing various special namespaces

Get the Spring newsletter

Thank you for your interest. Someone will get back to you shortly.

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Tanzu Spring Runtime offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all