Ellis Pritchard wrote:
Leszek Gawron wrote:
Daniel and I have found out some strange behaviour concerning JEXL in
Jxtg. Users started reporting this also:
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=110867204019252&w=2
The only thing we know is that the problems occur when the pipeline is
not invoked from flowscript.
<root xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
<test1>
<jx:set var="var1" value="foo"/>
<jx:out value="${var1}"/>
</test1>
<test2>
<jx:set var="map" value="${java.util.HashMap()}"/>
<jx:set var="ignored" value="${map.put('foo', 'bar')}"/>
<jx:out value="${map.foo}"/>
</test2>
</root>
For what we know test2 does not work. "map" variable is not properly
initialized.
Could anybody comment?
AFAICS (looking at the code) the 'java' Package object which you are
implicitly using when you do the ${java.util.HashMap()} is only set up
(and thus available to JXTemplate) if the FOM JavaScript interpreter is
called first in the context of the request. Thus this facility is not
set up generically for JXTemplates, only JXTemplates called from a flow.
Could you point me the direct code location?
This is why doing a 'null' flow which just calls your JX view works; the
java package is set up by the flow; if the 'null' flow also contained
other importPackage() function calls, you would also be able to use
those packages in the JXTemplate.
--
Leszek Gawron [EMAIL PROTECTED]
Project Manager MobileBox sp. z o.o.
+48 (61) 855 06 67 http://www.mobilebox.pl
mobile: +48 (501) 720 812 fax: +48 (61) 853 29 65