You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Andreas Hartmann <an...@apache.org> on 2009/07/29 22:27:22 UTC

[2.2] Global objectModel in JX components

Hi Cocoon devs,

I just noticed that the JX template generator uses a global object model 
in the execution context. This leads to problems when multiple JX 
template generators are called concurrently, e.g. if the processed 
template contains includes:

<template>

   ${cocoon.parameters.foo} -> "foo"

   <i:include src="…"/> (some JX generator, with parameter foo=bar)

   ${cocoon.parameters.foo} -> "bar"

</template>

The included JX template generator overwrites the cocoon/parameters 
object in the object model, which affects the outer template.

Would it make sense to pass a copy of the object model to the invoker 
instead of a reference to the global object model?

TIA for any comments!

-- Andreas


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


Re: [2.2] Global objectModel in JX components

Posted by Thorsten Scherler <th...@apache.org>.
On Wed, 2009-07-29 at 22:27 +0200, Andreas Hartmann wrote:
> Hi Cocoon devs,
> 
> I just noticed that the JX template generator uses a global object model 
> in the execution context. This leads to problems when multiple JX 
> template generators are called concurrently, e.g. if the processed 
> template contains includes:
> 
> <template>
> 
>    ${cocoon.parameters.foo} -> "foo"
> 
>    <i:include src="…"/> (some JX generator, with parameter foo=bar)
> 
>    ${cocoon.parameters.foo} -> "bar"
> 
> </template>
> 
> The included JX template generator overwrites the cocoon/parameters 
> object in the object model, which affects the outer template.
> 
> Would it make sense to pass a copy of the object model to the invoker 
> instead of a reference to the global object model?

Much more then simply overriding the model.

salu2

> 
> TIA for any comments!
> 
> -- Andreas
> 
> 
-- 
Thorsten Scherler <thorsten.at.apache.org>
Open Source <consulting, training and solutions>