cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: what happened to the global flow variables mapped to the session?
Date Wed, 15 Dec 2004 17:22:01 GMT
Stefano Mazzocchi wrote:

> I migrated an application that I wrote 18 months ago over to the 
> latest trunk and here are the incompatible things:
>  1) Rhino 1.6 is a lot more strict when you don't use "var" in front 
> of a variable declaration. The previous version of Rhino was more 
> tolerant. Not a problem but there is no back compatibility.

This is not related to Rhino, but to the way we handle the global scope. 
JavaScript states that if an unknown variable is used, it is attached to 
the global scope if it's not declared with "var" and to the local scope 

The problem is that both syntaxes (with and without "var) are correct, 
but lead to very different lifecycles of variables, especially when 
continuations are used. I added [1] this stricter behaviour after having 
spent half a day chasing a bug that was just a few "var" missing here 
and there in flowscript files. Several other people reported problems on 
the lists that were related to this implicit attachment of variables to 
the global scope.

>  2) it used to be that in order to have global variable persist across 
> calls even without continuations, you called cocoon.createSession() 
> and the flow put those values in the session. Then it was removed and 
> done automatically. Now, I can't find a way to make it work.

??? I'm using this daily and it works fine ???

> So, is anybody able to persist global flow variables across 
> non-continuated flow executions?

Well, that *should* work...



Sylvain Wallez                                  Anyware Technologies 
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }

View raw message