Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 36366 invoked from network); 19 May 2005 07:49:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 May 2005 07:49:26 -0000 Received: (qmail 1470 invoked by uid 500); 19 May 2005 07:48:49 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 1386 invoked by uid 500); 19 May 2005 07:48:48 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 1353 invoked by uid 99); 19 May 2005 07:48:48 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from essemtepe.nada.kth.se (HELO smtp.nada.kth.se) (130.237.222.115) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 19 May 2005 00:48:46 -0700 X-Authentication-Info: The sender was authenticated as danielf using PLAIN at smtp.nada.kth.se Received: from [192.168.105.31] ([192.58.197.189]) (authenticated bits=0) by smtp.nada.kth.se (8.12.11/8.12.11) with ESMTP id j4J7mRSQ020876 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 19 May 2005 09:48:27 +0200 (MEST) Message-ID: <428C44C5.20000@nada.kth.se> Date: Thu, 19 May 2005 09:48:21 +0200 From: Daniel Fagerstrom User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: JXPath environment expressions broken in jxtemplate References: <428C2C12.1030908@apache.org> In-Reply-To: <428C2C12.1030908@apache.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Reinhard Poetz wrote: > > Yesterday I tried to upgrade to the latest Cocoon and found out that > jxpath expressions don't work, e.g. #{$cocoon/request/protocol. > > Ideas? Aren't you following the list ;) http://marc.theaimsgroup.com/?t=111573583200002&r=1&w=2. It is a well known problem, the environment is accessed through o.a.c.environment.TemplateObjectModelHelper, which in turn uses the request etc wrappers from FOM. I made it this way because I wanted the refactored JXTG to have exactly the same behaviour as the original one. And after some the refactoring of FOM some months ago accessing of properties like your example above stoped working both for the original and the refactored JXTG. The problem is that the FOM wrappers extends org.mozilla.javascript.NativeJavaClass which JXPath doesn't work with, while JEXL have specialized reflection code for JS and still work atfter the FOM refactoring. The POJOfied Environment RT and vote threads was one step in geting rid of the dependency on the FOM wrappers. But there are still work left to do. Take a look at org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon.AttributeHolderJavaObject and the wrappers that extends it. From the description of the request wrapper: /** * JS wrapper for Cocoon's request object. *

* Request parameters are also present as properties on this object. * Note that this is different from FOM_Context and FOM_Session * that do the same with attributes. */ We must implement this behaviour in the TemplateObjectModelHelper before we can get rid of the dependency on FOM. There where something like that in TemplateObjectModelHelper once: > Carsten added such wrappers in rev 27976 of the > TemplateObjectModelHelper and removed them in 153807. Maybe we should > add them again ;) /Daniel