" /> WebWork: September 2005 Archives

« August 2005 | Main | October 2005 »

September 23, 2005

WebWork + Ivy = Awesome

As WebWork 2.2 wraps up, the only remaining task is documentation. One of the documentation efforts I've always hated is explaining the dependencies. Now that WebWork uses Ivy, we no longer have to do this. Instead, in the distribution, the depdencies are clearly graphed out. If you're not using Ivy or Maven2, you probably should take a look. I was a skeptic at first, but it really does make life easier.

Note: apologies about the weird formatting in that example -- the site CSS is clashing with the pages. It doesn't normally look like that.

WebWork in Action now available

After far too long, Jason and I are pleased to announce that WebWork in Action is now available in eBook format and will soon be on shelves. WebWork in Action covers WebWork version 2.1.7 (plus some 2.2 features) in more depth than any other publication currently available. We hope you enjoy it.

"My developers love it! We have already improved a couple of applications because of this book."
- Rickard Öberg, Software Architect, Senselogic, Founder of XDoclet and WebWork OpenSource projects.

"Well organized and covers all the bases!"
- Anoop Ranganath, Senior Architect, Green Bar Software

"Wow! People developing web apps need this. It?s very, very good!"
- Berndt Hamboeck, Senior Architect, Sybase

The WebWork framework implements a simple command/ business-logic and MVC design. It provides out-of-the-box functionality developers need to build well-designed applications that are modular and reusable. Written by its two primary developers, WebWork in Action is the first book to focus entirely on WebWork. Like a true "In Action" book, it is both a tutorial on WebWork and a sourcebook for its use in demanding, real-world applications.

Starting with "Hello World" the Webwork way, the book immerses the reader in practical, how-to material. You will soon know how to configure WebWork and gradually and incrementally master the robust and powerful uses of the framework. WebWork in Action uses the same basic, continuing example used in Manning's Hibernate in Action to show how to integrate WebWork with the popular Hibernate persistence framework.

What's Inside

* Handling data and displaying content with Expression Language and Tag Libraries
* Inversion of Control and WebWork actions
* VelocityType conversion and data validation
* Internationalization and component-oriented design
* Integration of web applications into the Hibernate persistence framework
* Webwork best practices and architecture

Spring and WebWork, together

As I have already mentioned, the WebWork team is fully committed to cooperating with existing Java community members. To fully demonstrate that commitment, WebWork has done what it should have done a long time ago: adopted Spring as the official IoC container. WebWork's own IoC container is deprecated as of version 2.2 beta 2.

On top of that, we recently updated how Spring integration works and made it even simpler to plug in. See the updated documentation here.

Example of WebWork Continuations

As mentioned in my last entry, WebWork now uses RIFE's continuation engine to provide a great new way to develop web applications. Now, if you choose, you can develop your applications using logical loops and control structures. This is effectively, as Bruce Tate likes to call it, a higher level way to express your program. A simple example is the following code:

public class Guess extends ActionSupport {
    int guess;

    public String execute() throws Exception {
        int answer = new Random().nextInt(100) + 1;
        int tries = 5;

        while (answer != guess && tries > 0) {
            pause(SUCCESS);

            if (guess > answer) {
                addFieldError("guess", "Too high!");
            } else if (guess < answer) {
                addFieldError("guess", "Too low!");
            }

            tries--;
        }

        if (answer == guess) {
            addActionMessage("You got it!");
        } else {
            addActionMessage("You ran out of tries, the answer was " + answer);
        }

        return SUCCESS;
    }

    public void setGuess(int guess) {
        this.guess = guess;
    }
}

Note how the conceptual "loop" of a number guessing game can now actually be represented as a loop in your Java code? Using RIFE's continuation engine, the class is instrumented to do some tricky stuff underneath, allowing the execution to start immediately after a pause() call. The result is a much more logic action.

We're eager to see what the community thinks!

RIFE and WebWork, together

With the release of WebWork 2.2 beta 2 today, we are happy to report the first collaboration effort between the RIFE team and the WebWork team. As some of you may already know, RIFE is an excellent development stack and is greatly admired by the entire WebWork team. One of the really great features in RIFE is its support for Continuations. Realizing that this could be a feature that other frameworks (especially those like RIFE, WebWork, Spring MVC, Struts, etc) could use, Geert, the RIFE lead, and I spent the last few days extracing the RIFE continuations code from the rest of RIFE.

The result is a new RIFE sub-project called RIFE/continuations. WebWork now includes an early version of this project and provides experimental support for continuations. While we won't be recommending anyone use them in production just yet, we wanted to add them as an optional element in version 2.2 to demonstrate a few things:

  1. We are committed to working with the Java community, not competing with them
  2. We want to get new features out as quickly as possible so users can play with them and give us feedback (this is why it is made optional and turned off by default, but still made available soon as possible)
  3. Through both Continuations and web page flows (Spring Web Flow and Beehive), the WebWork team is dedicated to making sure complex page flows/wizards are easy to do

We expect to continue to work with the RIFE team where it makes sense, cooperating instead of competing. Likewise, we have another development where we are working closely with another very popular Java framework... more on that in the next post.

WebWork 2.2 Beta 2 Released

WebWork 2.2 beta 2 has been released and can be downloaded from the download section on the WebWork site. This release contains a ton of bug fixes around type conversion and UI templates, as well as some compatibility issues various people have been facing. Thanks to everyone who helped test beta 1. As always, if you wish to stay on the bleeding edge, you can get the very latest jars at our Ivy repository, which is updated hourly.

There are a couple new developments in this release that we're going to dedicate a seperate blog entry for. Needless to say, we're very excited about them!