Friday, 14 March 2008
Ajax with Seam or Spring Web Flow?
« JavaWorld ICEfaces PodCast | Main | Ajax Calendar component with Spacetime extensions »When you're writing an Ajax application in Java (particularly using JavaServer Faces or ICEfaces) you will quickly find that you need more powerful abstractions to deal with scopes and navigation.
Of course, for many Ajax applications, navigation will not be necessary at all because an Ajax interface can often be created as a single page, but if you have any sort of workflow in your application, you will need to look beyond what can be done with JSF navigation rules.
Consider the standard scopes provided in the Java Servlet model (request, session, and application). Which of these scopes is suitable for multiple browser windows or tabs opened in the application? Clearly it's not "application", because that spans activity for all users, and it can't be "session" because that spans all activity for a given user. It also can't be "request", because a request spans only a single user interaction (but it can be the ICEfaces "extended request scope" where request spans a full page refresh). This is where Seam and Spring Web Flow come in. These frameworks do a variety of things that can help improve the architecture of your application, but specifically, they both provide additional scopes that work well with Ajax. With Seam, we get "conversation" and "view" scope, and with Spring Web Flow we get "flash", "flow", and "conversation" scopes. (With JSF 2.0, we're looking at "view" and "component" scopes, so those will be excellent to have in the standard.)
Which framework and which scope should you use? I'll provide the details in a talk at TheServerSide JavaSymposium on March 28th in Las Vegas. By presenting how these two frameworks allow you to work with new scopes and how they are integrated with the ICEfaces Ajax framework, you can then decide which configuration is best for your application.
Technorati Tags: ajax icefaces jsf seam spring springwebflow
Posted by at 6:53 PM in Entries by Ted Goddard
[Trackback URL for this entry]