This post originated from an RSS feed registered with Java Buzz
by dion.
Original Post: Struts Flow: Continations come to Struts
Feed Title: techno.blog(Dion)
Feed URL: http://feeds.feedburner.com/dion
Feed Description: blogging about life the universe and everything tech
Wow, Struts is a huge project:
Today, Struts is comprised of nine subprojects: Core, Taglib, Tiles, El, Faces, Scripting, Applications, Shale, and (now) Flow.
The Struts team just announced Struts Flow which brings a continuations based approach to web flows.
This is interesting stuff, and we have seen continuations popup in other communities such as Ruby, Perl, and Smalltalk.
Seaside was the first web framework that I saw with continuations, and it intrigued me from the beginning. It really does make sense to have the users 'session' to be the core. In fact, on our projects, we put a lot of functionality there (even if it just ties into the business layers etc).
It will be interesting to see how Struts Flow gets adopted.
Take a look at an example of putting the logic in one workflow, even though web pages are being sent around to get input from the user:
function main() {
var random = Math.round( Math.random() * 9 ) + 1;
var hint = "No hint for you!"
var guesses = 0;
while (true) {
// send guess page to user and wait for response
forwardAndWait("failure",
{ "random" : random,
"hint" : hint,
"guesses" : guesses} );
// process user's guess
var guess = parseInt( getRequestParams().guess );
guesses++;
if (guess) {
if (guess > random) {
hint = "Nope, lower!"
}
else if (guess
View the Announcement
The Apache Struts team is pleased to announce the adoption of its latest subproject, Struts Flow, a continuations-based approach to complex web workflows. Struts Flow originated at the struts.sf.net project and has been formally adopted now as a Struts subproject. Struts Flow is a port of Apache Cocoon's Control Flow to Struts to allow complex workflow, like multi-form wizards, to be easily implemented using continuations-capable Javascript and eventually Java.
Today, Struts is comprised of nine subprojects: Core, Taglib, Tiles, El, Faces, Scripting, Applications, Shale, and (now) Flow. Struts Flow is different from Struts Scripting/BSF as where Scripting brings any BSF-supported scripting language to Struts Actions, Struts Flow works on redefining the traditional Model 2 state-driven workflow into simplified scripts whose execution spans multiple requests. Currently, the Rhino engine, a Javascript implementation, is used to provide continuations support, but with the maturation of Jakarta Commons Javaflow - http://jakarta.apache.org/commons/sandbox/javaflow - a Java-based continuations implementation, Java will soon be supported as well.
For more information, visit the Struts Flow website at:
- http://struts.apache.org/flow