You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Don Brown <mr...@twdata.org> on 2004/06/03 23:44:20 UTC

[ANN] Struts-Flow 0.1 Released

Struts Flow is a port of Cocoon's <http://cocoon.apache.org> Control 
Flow <http://cocoon.apache.org/2.1/userdocs/flow/index.html> to Struts 
<http://struts.apache.org> to allow complex workflow to be implemented 
using continuations-capable JavaScript. It provides the ability to 
describe the order of Web pages that have to be sent to the client, at 
any given point in time in an application. The code is based on a 
proof-of-concept Dave Johnson put together 
<http://rollerweblogger.org/comments/roller/blog/jsp_control_flow_engine> 
to show how the Control Flow could be extracted from Cocoon.

While the initial target of the extracted Control Flow is Struts, the 
Flow code is reusable from other non-Struts environments. This means 
Control Flow could be used to drive non-Struts JSP applications, 
portlets, or even complex web services.

For more information, see the project's temporary website: 
http://struts.sf.net/struts-flow

To show the code in action, here is the implementation of a number 
guessing game:

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 < random) {
        hint = "Nope, higher!"
      } 
      else {
        // correct guess
        break;
      }
    }
  }

  // send success page to user
  forwardAndWait("success", 
     {"random"  : random, 
      "guess"   : guess, 
      "guesses" : guesses} );
}

Don


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Use Date or Calendar (GregorianCalendar) to store information?

Posted by Fabrício Garcia Imbrizi <fa...@murah.com.br>.
All,

	Use Date to store data and Calendar to manipulate data is the best choice?
	What´s the advantage in store data with Calendar insted of Date?

	Thanks.

   Atenciosamente

   Fabrício Garcia Imbrizi
   Murah Technologies
   11 8275 0199




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org