cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Oliver <res1c...@verizon.net>
Subject Re: cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/fom FOM_JavaScriptInterpreter.java
Date Mon, 14 Jul 2003 17:04:04 GMT
On second thought, the design of only creating a session only when 
cocoon.session is referenced won't work. The global JavaScript scope is 
saved in the session so that top-level functions called from the sitemap 
using <map:call> will share global variables. This must occur whether 
you reference cocoon.session or not.

Regards,

Chris

Christopher Oliver wrote:

> This is a bug in the implementation, then. Currently, it _always_ 
> creates a session.
>
> Geoff Howard wrote:
>
>> Pretty sure - the code is in cvs:
>> http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/eventcache/samples/event.js?rev=1.1&content-type=text/vnd.viewcvs-markup

>>
>>
>> But this is the whole thing:
>>
>> var role = Packages.org.apache.cocoon.caching.Cache.ROLE;
>>
>> function cacheEvent() {
>>     var cache = cocoon.getComponent(role);
>>     var event = new 
>> Packages.org.apache.cocoon.caching.validity.NamedEvent("one");
>>     var rand = Math.random() * 10000000000000000000;
>>     cache.processEvent(event);
>>     cocoon.releaseComponent(cache);
>>     cocoon.redirectTo("demo?pageKey=" + cocoon.request.pageKey + 
>> "&rand="+rand);
>> }
>>
>> Geoff
>>
>>
>> Reinhard Pötz wrote:
>>
>>> From: Geoff Howard
>>>
>>>
>>>> Christopher Oliver wrote:
>>>>
>>>>> Yes. That is a feature of the new FOM: it always creates a 
>>>>> session. The
>>>>> original API had createSession() and removeSession(). Those 
>>>>
>>>>
>>>>
>>>> functions
>>>>
>>>>> were removed from FOM.
>>>>
>>>>
>>>>
>>>> I thought that was only supposed to happen after a reference to 
>>>> cocoon.session, or when a continuation is created.  Can someone 
>>>> confirm?
>>>
>>>
>>>
>>>
>>> Yep. If there is no reference to cocoon.session no session should be
>>> created. So if you get a session if you redirectTo(uri) you 
>>> discovered an error. One question: Are you sure that you haven't
>>> created a session somewhere else?
>>>
>>> Cheers,
>>> Reinhard
>>
>>
>>
>>
>
>
>



Mime
View raw message